Building Simple-JTA V2

Download source code

Download the source code for SimpleJTA from the SimpleJTA website. Extract the source into a directory. This directory will be referred to as the ${simplejta.home} directory in the rest of this document.

Download required software

Following software is required to build SimpleJTA.

J2SE SDK 1.4.2 or above

SimpleJTA requires JDK 1.4.2 or above. Unfortunately, JavaSE 6.x cannot be used to build SimpleJTA as the specification of DataSource has changed in this version of Java. Download and install JDK as per instructions provided with the release. We will refer to the installation directory as ${java.home} in the rest of this document.

Maven 2

Download and install Maven 2. Ensure that maven binaries are in your PATH.

Java Transaction API (JTA) 1.0.1B

Download JTA 1.0.1B (jta-1_0_1B-classes.zip) from Sun Java website by selecting "Class files". Save jta-1_0_1B-classes.zip file in a temporary directory. Execute following command to import this library into the maven repository:

mvn install:install-file -DgroupId=javax.transaction -DartifactId=jta -Dversion=1.0.1b -Dpackaging=jar -Dfile=/path/to/jta-1_0_1B-classes.zip

Java Message Service API (JMS) 1.1

Download JMS version 1.1 API Documentation, Jar and Source bundle (jms-1_1-fr-apidocs.zip) from Sun Java Website. Open the zip file and extract the file named jms.jar to a temporary directory. Execute following command to import this library into the maven respository:

mvn install:install-file -DgroupId=javax.jms -DartifactId=jms -Dversion=1.1 -Dpackaging=jar -Dfile=/path/to/jms.jar

Download Apache Derby 10.2.2.0

Download Apache Derby 10.2.2.0 and install it. Create a database on your local filesystem named /derby/databases/tca and SimpleJTA tables using the create_tables.sql script located under src/main/sql/tm/derby. Also create a table called dept. A sample session with Apache Derby tool ij is shown below:

ij> connect 'jdbc:derby:/derby/databases/tca;create=true';
ij> create table dept (
        deptno decimal(2) not null constraint dept_pk primary key,
        dname varchar(30),
        loc varchar(30)
);
0 rows inserted/updated/deleted
ij> run 'src/main/sql/tm/derby/create_tables.sql';
ij> exit;

Download Apache ActiveMQ 4.1.1

Download Apache ActiveMQ 4.1.1. Install it as per instructions with the package and start ActiveMQ.

Create Eclipse project

Following steps can be used in Eclipse 3.2.x to create the SimpleJTA V2 project:

Open a command shell and change directory to the project's home folder. Execute following command to generate the Eclipse project settings:

mvn eclipse:eclipse
You need to have an internet connection for the maven command to work properly. It will download all the dependencies required for building SimpleJTA V2.

Switch back to Eclipse and refresh the project. A small J should appear against the project in PackageExplorer view indicating that Eclipse has recognised this as a Java project.

The project will be automatically built by Eclipse. You can also run the usual maven commands to compile, test, package and install SimpleJTA binaries.


SourceForge.net Logo