Compile and Run application with JBoss applicaton server


IMPORTANT PRE-REQUISITES

1. Set up environment to compile and run the sample application

The following script must be run for each of the terminal session:

Windows:   > quickstart/ttquickstartenv.bat
Unix/Linux:   $ . quickstart/ttquickstartenv.sh OR
$ source quickstart/ttquickstartenv.csh

2. Set up sample database, user accounts and the TPTBM table

The following command should be run once to set up the sample database, user accounts and the TPTBM table.

Windows or Unix/Linux:   > cd quickstart/sample_code/j2ee_orm
> ttIsql -connStr "DSN=sampledb_1122" -f tptbm.sql

3. If necessary, install the Apache Ant build tool.

For each application server, an Ant build script is provided to configure, build and execute the application based on the properties of the applicaton server installation. The Apache Ant build tool has to be installed if not present.

After installation, make sure the Operating System environment variable PATH includes the path to the 'ant' executable.

The Ant build scripts have been tested with Apache Ant version 1.6.5.

  

CONFIGURE AND RUN

1. install JBoss application server and configure build.properties

Install JBoss applicaton server 5.1.0 GA and then set the following properties in file quickstart/sample_code/j2ee_orm/build.properties:

    jboss.home.dir   -- set this to the root installation directory of the local
                        JBoss server installation

    jboss.server.dir -- the location of the JBoss server directory for the 
                        server hosting the Tptbm entity bean

    jboss.deploy.dir -- the directory where application archives can be copied 
                        and auto deployed to the JBoss server
                              
    jboss.host       -- the host name of the machine where the server is
                        installed

    jboss.port       -- the RMI port number used by external clients to 
                        communicate with the server, the default port number is 
                        1099
Each Ant build script reads values from file quickstart/sample_code/j2ee_orm/build.properties. This file specifies the locations of build dependencies including the location of the application server installation. This file also specifies the common benchmark execution parameters.

2. TimesTen JDBC Driver

The server will require access to the TimesTen JDBC driver jar file. This can be done by copying the TimesTen JDBC driver jar file from the TimesTen installation's lib directory into the ${jboss.server.dir}/lib directory.

3. LD_LIBRARY_PATH

The server will also need access to the TimesTen shared libraries. This can be done by setting the LD_LIBRARY_PATH environment variable (or the equivalent variable for your OS) to the location of the TimesTen installation's lib directory. On Windows platforms the PATH environment variable should be set to the location of the installation's bin directory where TimesTen DLLs are located.

4. TimesTen Data Source

Before the application can be deployed or executed, a TimesTen data source with the JNDI name of java:TbtbmDirectDS must be configured on the server. An example configuration file for this data source is provided by the sample application at quickstart/sample_code/j2ee_orm/config/jboss5/timesten-ds.xml. This is a stand-alone configuration file. It should be copied to the ${jboss.deploy.dir} directory of the server. The server will read this configuration file when it starts up and then add the data source to its JNDI tree.

5. TimesTen Type Mapping

The JBoss timesten-ds.xml configuration file has a dependency on a JBoss <type-mapping> descriptor called TimesTen. The definition for the TimesTen <type-mapping> descriptor is located in the application's quickstart/sample_code/j2ee_orm/config/jboss5/timesten-type-mapping.xml file. This is not a stand-alone file. The contents of this file must be copied and pasted into the <type-mappings> section of the JBoss standardjbosscmp-jdbc.xml file located at ${jboss.server.dir}/conf/standardjbosscmp-jdbc.xml.

Restart the JBoss server in order for the changes above to take effect.

6. build, deploy and run the sample application

After the server has been configured to use the java:TptbmDirectDS data source and restarted, the application can be built, deployed, and executed, through Ant script build-jboss5.xml, with this sequence of Ant tasks under directory quickstart/sample_code/j2ee_orm:

   ant -f build-jboss5.xml clean
   ant -f build-jboss5.xml package
   ant -f build-jboss5.xml deploy
   ant -f build-jboss5.xml run
   

Note that this application has been tested with JBoss Server 5.1.0.

 

TROUBLESHOOTING

 

For more information on Java programming with Oracle TimesTen, refer to the Oracle TimesTen In-Memory Database Java Developer's Guide.