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 or RAM disks; 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 useful 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 duplicated 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 (not JRE) version of 1.7.x or later

Deployment on Tomcat
  1. Create a file at path <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 directory <ULTRA_HOME>webapp/WEB-INF/lib. Note: You may need to create this directory. Never copy the servlet-api-*.jar file or JARs from the lib/endorsed directory

  3. Update the <ULTRA_HOME>/webapp/WEB-INF/classes/conf directory configuration files - especially the ultra-root.xml, ultra-dynamic.xml and ultra-common.xml as necessary for deployment.

    1. Make sure that the "fileCache" bean specifies an absolute directory to its constructor (e.g. "/tmp" instead of "tmp")

    2. Specify the absolute path to any dynamic sub contexts loaded (e.g. "dynamicSubContexts" property entries of the "ultra-config" bean)

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: You may need to create this directory. Never copy the servlet-api-*.jar file or JARs from the lib/endorsed directory

  3. Update the <ULTRA_HOME>/webapp/WEB-INF/classes/conf directory configuration files - especially the ultra-root.xml, ultra-dynamic.xml and ultra-common.xml as necessary for deployment.

    1. Make sure that the "fileCache" bean specifies an absolute directory to its constructor (e.g. "/tmp" instead of "tmp")

    2. Specify the absolute path to any dynamic sub contexts loaded (e.g. "dynamicSubContexts" property entries of the "ultra-config" bean

  4. Copy <ULTRA_HOME>/webapp folder into the JBoss deploy directory (e.g. as 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 over the public forums.

 References

[2] 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

In this topic
In this topic
Contact Us