You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@beehive.apache.org by Bryan Che <bc...@redhat.com> on 2004/11/10 23:16:45 UTC
Running Beehive on JOnAS
Hi, these are instructions for running the Beehive Petstore sample
application on JOnAS, an open-source application server hosted at
ObjectWeb (http://jonas.objectweb.org/). These instructions work with
the Beehive v1alpha branch and JOnAS 4.1.4.
1. Patch JOnAS
--------------
Beehive requires Java 5, but JOnAS 4.1.4 will not run under Java 5. So,
you need to patch JOnAS in order for it to run under Java 5. To do
this, download the source for JOnAS 4.1.4 or check it out from CVS.
Also, download the source code for Jakarta Tomcat 5.0.
Then, get from CVS an updated version of the file
jonas/jonas/src/org/objectweb/jonas/server/Bootstrap.java. Currently,
this is at revision 1.51:
http://cvs.forge.objectweb.org/cgi-bin/viewcvs.cgi/jonas/jonas/src/org/objectweb/jonas/server/Bootstrap.java?rev=1.51&content-type=text/vnd.viewcvs-markup.
Replace the Bootstrap.java file in your JOnAS source directory with this
updated version, and then rebuild JOnAS-Tomcat using your patched source
by following the instructions in the source code's README file. Be sure
to build JOnAS-Tomcat by running the "install_tomcat" ant target.
2. Build Petstore
------------------
Build the Petstore sample application just as you normally would by
following the instructions at
http://incubator.apache.org/beehive/jpetstore.html.
Then, package the Petstore as a war: Go into
BEEHIVE_HOME/samples/petstoreWeb/ and type
jar cvf petstoreWeb.war *
Copy petstoreWeb.war to JONAS_HOME/webapps/autoload/
Alternatively, you can just copy or link the directory
BEEHIVE_HOME/samples/petstoreWeb to JONAS_HOME/webapps/autoload/.
3. Update Axis
---------------
JOnAS-Tomcat includes its own copy of Axis. However, this version is
not compatible with the one in Beehive. So, you will need to replace
JOnAS's copy.
First, backup the two jar files, axis-ant.jar and axis.jar, under
JONAS_HOME/lib/commons/jonas/axis/ in case you need them again. Then,
replace these files with the versions from Beehive:
cp $BEEHIVE_HOME/samples/petstoreWeb/WEB-INF/lib/axis*.jar
$JONAS_HOME/lib/commons/jonas/axis/
4. Update JOnAS config
-----------------------
You may want to update two settings in JOnAS's configuration to make it
more like the Tomcat configuration that comes with Beehive. First,
update JONAS_HOME/conf/server.xml so that JOnAS will listen on port 8080
rather than 9000: Replace
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 9000 -->
<Connector port="9000"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="9043" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />
with
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
<Connector port="8080"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="9043" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />
You may also want to use log4j for logging. Update
JONAS_HOME/conf/trace.properties by commenting out the line,
log.config.classname
org.objectweb.util.monolog.wrapper.javaLog.LoggerFactory
and uncommenting the line,
log.config.classname
org.objectweb.util.monolog.wrapper.log4j.MonologLoggerFactory
Finally, make sure that log4j is in your CLASSPATH when running the
JOnAS server. For example, you could copy the log4j jar from
BEEHIVE_HOME/samples/petstoreWeb/WEB-INF/lib/ to JONAS_HOME/lib/ext/.
NOTES
-----
These are some miscellaneous notes about running Beehive on JOnAS:
-JOnAS is much more stringent with XML parsing than Tomcat. I had to
submit several patches to Beehive to fix various XML files.
Additionally, there is a bug in XMLBeans so that it doesn't generate a
doctype for XML files. This leads to startup errors in JOnAS with
Beehive on the trunk (the alpha branch has a workaround). See
http://nagoya.apache.org/jira/browse/BEEHIVE-30 for more information.
-Many of the extra steps in this document won't be necessary in the
future for running Beehive in the future once there are released,
compatible versions of Beehive and JOnAS.
-I intend to explore augmenting the current Beehive build/deploy/test
framework so that it will support JOnAS and other application servers
beyond Tomcat.
I hope people find this helpful. I will be at ApacheCon this coming
week demonstrating Beehive running on JOnAS at the Beehive booth.
Bryan Che