The manual installation process is significantly harder then the automatic installation which we normally recommend. In this installation process you will do the following:
Once Tomcat has been installed , the OpenEJB plugin for Tomcat can be installed. The war can be obtained from the [OpenEJB download page|http://people.apache.org/~dain/openejb-temp] . The commands in this example are executed from within the Tomcat installation directory.
Due to the structure of war files, you must create a new directory for OpenEJB, change to the new directory and execute the unpack command from within the new directory. If you get this wrong, it is difficult to undo, so follow the steps closely.
C:\apache-tomcat-6.0.14>cd webapps\openejb
C:\apache-tomcat-6.0.14\webapps\openejb>jar -xvf \openejb.war created: WEB-INF/ created: WEB-INF/classes/ created: WEB-INF/classes/org/ created: WEB-INF/classes/org/apache/ created: WEB-INF/classes/org/apache/openejb/ ...snip...
C:\apache-tomcat-6.0.14\webapps\openejb>dir Volume in drive C has no label. Volume Serial Number is 0000-0000
Directory of C:\apache-tomcat-6.0.14\webapps\openejb
09/21/2007 10:19 AM
C:\apache-tomcat-6.0.14\webapps\openejb>cd ....
C:\apache-tomcat-6.0.14>
{card:label=Unix}{noformat:nopanel=true}
apache-tomcat-6.0.14$ mkdir webapps/openejb
apache-tomcat-6.0.14$ cd webapps/openejb/
apache-tomcat-6.0.14/webapps/openejb$ jar -xvf path/to/openejb.war
created: WEB-INF/
created: WEB-INF/classes/
created: WEB-INF/classes/org/
created: WEB-INF/classes/org/apache/
created: WEB-INF/classes/org/apache/openejb/
...snip...
apache-tomcat-6.0.14/webapps/openejb$ ls
LICENSE META-INF/ NOTICE README.txt WEB-INF/ index.html
lib/ openejb.xml tomcat/
apache-tomcat-6.0.14/webapps/openejb$ cd ../..
apache-tomcat-6.0.14$
All Tomcat listener classes must be available in the Tomcat common class loader, so the openejb-loader jar must be copied into the Tomcat lib directory.
{card:label=Unix}{noformat:nopanel=true}
apache-tomcat-6.0.14$ cp webapps/openejb/lib/openejb-loader-*.jar
lib/openejb-loader.jar
Add the following {highlight}highlighted lines{highlight} to your conf/server.xml file to load the OpenEJB listener:
Tomcat contains an old non-compliant version of the javax.annotation classes and these invalid classes must be updated so OpenEJB can process annotations. Simply, replace the annotations-api.jar in the Tomcat lib directory with the updated annotations-api.jar in the OpenEJB war.
{card:label=Unix}{noformat:nopanel=true}
apache-tomcat-6.0.14$ cp webapps/openejb/tomcat/annotations-api.jar
lib/annotations-api.jar
OpenJPA, the Java Persistence implementation used by OpenEJB, currently must enhanced persistence classes to function properly, and this requires the installation of a javaagent into the Tomcat startup process.
First, copy the OpenEJB JavaAgent jar into the lib directory.
{card:label=Unix}{noformat:nopanel=true}
apache-tomcat-6.0.14$ cp webapps/openejb/lib/openejb-javaagent-*.jar
lib/openejb-javaagent.jar
Simply, add the following {highlight}highlighted lines{highlight} to the bin/catalina.bat (Windows) or bin/catalina.sh (Unix) file to enable the OpenEJB javaagent:
echo Using CATALINA_BASE: %CATALINA_BASE% echo Using CATALINA_HOME: %CATALINA_HOME% ...snip...
# Bugzilla 37848: only output this if we have a TTY if OPENEJB: $have_tty -eq 1 ; then echo "Using CATALINA_BASE: $CATALINA_BASE" ...snip...
NOTE: The example above is an excerpt from the middle of the bin/catalina.sh file. Search for "Execute" in the file to locate the correct position in the file to add the new lines.