Running Tomcat in jBoss 2.0
Goal
Running Tomcat inside the same VM as jBoss provides a couple of benefits :
- Better performance: if you have servlets, Java Beans or JSPs which access
some EJBs, the speed will dramatically increase since there's no more RMI
calls. Plain Java calls are used instead.
Nota : As of 07/03/2000, due to some ClassLoader problems, this feature is
not yet implemented, and the calls are not as fast as we would like. We hope
to fix this soon.
- Provides a more complete J2EE server, requiring only one command to startup
both the EJB server and the Servlet/JSP server.
How-To
By default, when you start jBoss, it automatically tries to launch Tomcat as
well. To disable this feature, suppress the lines
<MLET CODE = "org.jboss.tomcat.TomcatService"
ARCHIVE="jboss.jar" CODEBASE="../lib/ext/">
</MLET>
at
the end of the file jboss.conf
.
In order for jBoss to find Tomcat's classes, you need to set a couple of environment
variables :
- TOMCAT_HOME must point to the base directory of Tomcat's binaries. Typically,
if you built Tomcat from jakarta/jakarta-tomcat, TOMCAT_HOME should point
to jakarta/build/tomcat.
- SERVLETAPI_HOME must point to the source directory "jakarta-servletapi".
The file $SERVLETAPI_HOME/lib/servlet.jar will be required.
- Your CLASSPATH must contain $JAVA_HOME/lib/tools.jar since Tomcat needs
this to compile JSPs.
Note that all these requirements are those of Tomcat. If you fail in any of
these, you won't be able to start Tomcat in jBoss VM.
Future enhancements
Integrate Tomcat more tightly to jBoss. Fix the invocation speed problem. Provide
an EAR deployer. Unify the security model... What else ?