USING JUMPSTART IN TOMCAT 6.0 OR 5.5

Contents
Prepare Tomcat
Build and deploy JumpStart
Build, deploy, and integration test JumpStart
Use JumpStart
How to run integration tests from Eclipse
How to debug the client side
How to debug the server side

Prepare Tomcat
These instructions prepare Tomcat with the following elements:

Web Server Business Server Persistence Database Server Logger
Tomcat OpenEJB3 Hibernate HSQLDB Log4j
(Added by us) (Added by us) (Tomcat's default) (Added by us)

The DataSource is set in ${catalina.base}/conf/openejb.xml. By default it uses the HSQLDB whose files are in ${catalina.base}/data/hsqldb/.

Build and deploy JumpStart

Here we use Ant to clean, compile, unit test, package, deploy to the server, and wait for it to load.
The deployed package is jumpstart.war.

Build and deploy and integration test JumpStart

Here we use Ant to clean, compile, unit test, package, deploy to the server, wait for it to load, and run the business integration test suite.
The deployed package is jumpstart.war. The tests remotely call the JumpStart business layer services exposed by the server.

Use JumpStart

Ensure the command line is using Java 1.6: the commands java -version and javac -version must return a variant of 1.6, eg. 1.6.0_13.

Start Tomcat (as above).

Confirm Tomcat is using Java 1.6: when you start Tomcat it returns 4 messages, with the last one giving the JRE_HOME path. The JRE_HOME must be a Java 1.6 JRE or JDK. If it is Java 1.5 or earlier, then shut down Tomcat and fix this before proceeding.

Before you use JumpStart for the first time in a new server, you need to build it, deploy it, and run an integration test.

Stop Tomcat (as above).

Populate the Hypersonic database (HSQLDB) within Tomcat: in Eclipse...

Start Tomcat (as above).

When the server is running you can visit JumpStart with your web browser at http://yourserver:8080/jumpstart.

How to run integration tests from Eclipse

First, build and deploy JumpStart as described above.

Second, create a User Library over Tomcat:

Third, run or debug the business integration test suite from Eclipse:

  • Choose Run > Run Configurations... or Run > Debug Configurations.... The relevant window will appear.
  • Right-click on JUnit and choose New.
  • Set Test Runner to JUnit 4.
  • Set the other variables to values similar to those shown in the screen shot on the right.
  1. Click on the Classpath tab.
  2. Remove the (default classpath) entry.
  3. Click on User Entries.
  4. Add folder business/src/test/conf-remote-tomcat/ .
  5. Add folder collapsed/jumpstart.war/WEB-INF/classes/ or,
    if you're using an exploded EAR,
    then add folder exploded/jumpstart.ear/jumpstart.jar/ .
  6. Add all JARs from these folders:
    business/src/main/lib-compile/
    business/src/main/lib-provided/
    business/src/main/lib-runtime/
    business/src/test/lib-test/
  7. Add user library tomcat-6.0-client-lib or tomcat-5.5-client-lib .
  8. Move the two folders to the top. It avoids conflicts.

How to debug the client side

To debug, for example, the client side of the integration tests, use Run > Debug Configurations... instead of Run > Run Configurations.... Eclipse will then stop at breakpoints, display variables, enable single-stepping, etc. in the test suite.

How to debug the server side

To debug any part of JumpStart as it runs in the server you'll need to be running Tomcat in debug mode. There are a couple of ways to do it:

 












©2008 Geoff Callender, Sydney, Australia