Compiere is designed to support generic J2EE Application server, but as usual, there are some detail considerations. Out of the box, Compiere supports JBoss and manages it's configuration and deployment. In addition to JBoss, you can deploy the full application server to IBM WebSphere (WAS), Oracle Application Server (OAS) and others in addition to deploying the web containers in Tomcat.
In the setup dialog, you have the choice of "jboss", "tomcatOnly" and "ibmWAS" (the "oracleAS" option is disabled at the moment). In this blog, I will describe how best to implement the different options.
Let's start with stand alone Tomcat. You can deploy war (WebArchive) files to Tomcat, examples are the web store, the web user interface. You may do that for performance reasons and you always need another application server for the full functionality. When selecting Tomcat in the Compiere Setup, you need to provide a path to your Tomcat deployment directory. When starting Tomcat, you need to make sure that you add the Compiere Home variable to the Tomcat start command
(example: -DCOMPIERE_HOME=C:\Compiere2)
and you must configure the port to listen on. I suggest that you rename the war file as the context provided is the exact name of the war file.
The JBoss deployment and configuration is very easy - just fill in the Web, SSL and JNP port. The setup checks if the ports are available for JBoss. For other application servers, Compiere provides the files, but you need to do the configuration yourself. The main issue is to set the Compiere Home (as described for Tomcat above).
When deploying to other application servers, you need to know what the difference is to JBoss. First, JBoss generates the RMI stubs dynamically. If your application server does not support that, you can use the application server specific tools (e.g. IBM WebSphere or Oracle Developer) and use their deployment tools, which then generates the stubs. For WAS, Compiere provides the structure to create and integrate the subs - have a look at the Ant build file build.xml in the Compiere2 directory for details. It is easy to adapt the Ant code to the different libraries for your application server.
Secondly, in JBoss you should not deploy the same libraries (jar files) multiple times, but use the /jboss/server/compiere/lib directory for those common files. Other application server have more isolation between the instances (ear files) and require all files to be included. Check the documentation of the apps server how to deal with shared/common files. Initially, Compiere used the shared file approach but we then generated the ear files with the complete set of files for each. This resulted in a minor issue (no observable defects), that static variables were instanciated multiple times, overwriting the previous class. This is due to the JBoss approach that each ear/war file has it's own class loader. You can check this in the log directory - the server log was started by one deployment and when the next one started, another file was created. This is fixed in release 3.2.
If you want to create ear/war files with all libraries (e.g. for deployment of a dedicated or parallel server), change in the file duild.xml the lines
from
<condition property="baseJars" value="" else="Compiere.jar,CompiereSLib.jar," >
<equals arg1="jboss" arg2="${COMPIERE_APPS_TYPE}" />
</condition>
to
<property name=" baseJars " value=" Compiere.jar,CompiereSLib.jar," />
Lastly, the only specific JBoss feature Compiere is using is to tunnel RMI (i.e. JNP) over HTTP. This is used when you set the connection profile of the Swing Client to WAN and allows to connect to the application server through a firewall. WAS planned to make that available too, but check the apps server vendor for details.