Deploying the UltraESB on Tomcat or a JEE Application Server

The UltraESB uses its own high performance and asynchronous HTTP/S transports using Java NIO, Zero-Copy and Memory mapped file IO; and thus a JEE application server deployment will not yield anything by the use of the application servers' servlet container support. However, the use of an application server JTA transaction manager, Datasources and JMS resources is still a valid and common use-case, while accessing EJB's during mediation is another. Some users also prefer to deploy all applications over Tomcat or another JEE server for administrative or operational reasons.

Motivation for deploying the UltraESB on an application server

Running the UltraESB within a JEE server as a web application allows efficient and possibly optimal in-JVM use of JEE server resources. This could be via use of server defined JMS connection factories, or Datasources, or the use of the application server JTA transaction manager. During mediation, it maybe preferable to invoke EJBs as well, and this again is simplified and optimized when the UltraESB is deployed within the same application container.

However, most if not all these advantages may still be valid when a non-application server JTA transaction manager such as Atomikos is used with Spring defined Datasources against remote databases and use of an external JMS server such as ActiveMQ etc.

JEE application server support for JTA transactions

The JTA specification section 3.2.3 states : "Note that some transaction manager implementations allow a suspended transaction to be resumed by a different thread. This feature is not required by JTA" . Thus during mediation, if a XA transaction needs to be suspended and resumed from a separate thread, you would require the use of a JTA transaction manager that supports it. JBoss and Weblogic application servers limit this support to applications deployed locally - See [1],[2] and [3].

Deployment of the UltraESB as a Web Application aRchive (WAR)

The UltraESB distribution includes a directory webapp, which contains a skeleton WAR for deployment to an application server. However, the JAR files required still needs to be copied from the <ULTRA_HOME>/lib directory into the <ULTRA_HOME>/webapp/WEB-INF/lib directory, as they are not duplication within the distribution.

Note:
1. In the following examples, replace <ULTRA_HOME> with the absolute path to your UltraESB installation root directory
2. Any application server containers will need to run with a JDK version of 1.6.x or later

Deployment on Tomcat

1. Create a file <TOMCAT_HOME>/conf/Catalina/localhost/ultraesb.xml with the following line of text

<Context path="/ultraesb" docBase="<ULTRA_HOME>/webapp"  reloadable="true" privileged="true"/>

2. Copy all JAR files from <ULTRA_HOME>/lib [and its sub-directories if/as necessary] into the <ULTRA_HOME>webapp/WEB-INF/lib. Note: Never copy the servlet-api-*.jar file or JARs from the lib/endorsed directory

JBoss deployment (JBoss AS 5.1.0 GA)

1. Set a system property 'ultra.home' to point to the <ULTRA_HOME> root directory. You could set this on the jboss-5.1.0.GA/bin/run.sh file by adding the following line just before the "JBoss Bootstrap Environment" section.

JAVA_OPTS="$JAVA_OPTS -Dultra.home=<ULTRA_HOME>"

Note. The 'ultra.home' system property is used to determine the classpath to be used when compiling sequences that are specified as Java source fragments, or script etc. Thus, note that you may need to ensure any required custom JAR files are available in both <ULTRA_HOME>/lib and <ULTRA_HOME>webapp/WEB-INF/lib

2. Copy all JAR files from <ULTRA_HOME>/lib [and its sub-directories if/as necessary] into the <ULTRA_HOME>webapp/WEB-INF/lib. Note: Never copy the servlet-api-*.jar file or JARs from the lib/endorsed directory

3. Copy <ULTRA_HOME>/webapp folder into the JBoss deploy directory (e.g. jboss-5.1.0.GA/server/default/deploy/ultraesb.war)

Other Application Servers

AdroitLogic would be willing to help any users deploying on other application servers. Please request assistance via the forums at http://adroitlogic.org

[1] http://www.jboss.com/?module=bb&op=viewtopic&t=35448

[2] http://lists.jboss.org/pipermail/jboss-user/2007-March/046648.html

[3] Weblogic will not let you access XASession.getXAResource() outside of the server and will throw an IllegalStateException - getXAResource can only be called from the server