...
Overview
The manual installation process is significantly harder then the automatic installation which we normally recommend. In this installation process you will do the following:
- Install openejb.war
- Download openejb.war from the OpenEJB download page
- Make webapps/openejb directory
- Change to new webapps/openejb directory
- Unpack the openejb.war file in the new directory
- Add the OpenEJB listener the conf/server.xml file
- Update the non-compliant Tomcat annotations-api.jar
- Add the OpenEJB JavaAgent to the bin/catalina.bat or bin/catalina.bat script
install-openejbInstall openejb.war
Once Tomcat has been installed, the OpenEJB plugin for Tomcat can be installed. The war can be obtained from the OpenEJB download page. The commands in this example are executed from within the Tomcat installation directory.
Unpack OpenEJB Tomcat plugin in Tomcat webapps directory
...
This is the most error prone step. A web application does not contain a root directory, so if you unpack it in the wrong directory, it is difficult to undo. Please, follow this step closely, and most importantly make sure you execute the unpack command from within the new webapps/openejb 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.
...
...
Add the OpenEJB listener to Tomcat
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.
...
...
Add the following
...
conf/server.xml
<!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
-->
<Server port="8005" shutdown="SHUTDOWN">
...
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
...snip...
Update the Tomcat annotations-api.jar file
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.
...
...
javaagent Add OpenEJB javaagent to Tomcat startup
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.
...
...
Simply, add the following
...
...snip...
if not exist "%CATALINA_BASE%\conf\logging.properties" goto noJuli
set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties"
:noJuli
if not exist "%CATALINA_BASE%\webapps\openejb\lib\openejb-javaagent.jar" goto noOpenEJBJavaagent
set JAVA_OPTS="-javaagent:%CATALINA_BASE%\webapps\openejb\lib\openejb-javaagent.jar" %JAVA_OPTS%
:noOpenEJBJavaagent
rem ----- Execute The Requested Command ---------------------------------------
echo Using CATALINA_BASE: %CATALINA_BASE%
echo Using CATALINA_HOME: %CATALINA_HOME%
...snip...
...
...snip...
# Set juli LogManager if it is present
if -r "$CATALINA_BASE"/conf/logging.properties; then
JAVA_OPTS="$JAVA_OPTS "-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" "-Djava.util.logging.config.file="$CATALINA_BASE/conf/logging.properties"
fi
if -r "$CATALINA_BASE"/webapps/lib/openejb-javaagent.jar; then
JAVA_OPTS=""-javaagent:$CATALINA_BASE/lib/openejb-javaagent.jar" $JAVA_OPTS"
fi
# ----- Execute The Requested Command -----------------------------------------
# Bugzilla 37848: only output this if we have a TTY
if $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.ADD MANUAL INSTALLATION INSTRUCTIONS HERE