SECTION: 600-J2EE TITLE: JBoss QUESTION: Jetty JBoss Integration. <h3>Background</h3> <p> Jetty was the default web container for the <a href="http://sourceforge.net/projects/jboss/">JBoss</a> application server from release 3.0 to 3.2.2. The JBoss CVS repository contains a fork of the Jetty code, which is presented under the name JBossWeb. Unfortunately due to commercial differences between Mort Bay Consulting and the JBoss Group LLC, the Jetty developers are no longer able to maintain the copy withing JBoss Project. </p> <p> The Jetty project itself has now taken responsibility for maintaining the JBoss Jetty integration and a JBoss Jetty SAR (service archive) is part of each Jetty release and can be built directly from Jetty CVS. </p> <h3>Installing JBossJetty.sar</h3> The following steps will allow you to update a JBoss release to use a JBossJetty.sar: <ol> <li> Down load the JBoss Jetty release that you require from <a href="http://sourceforge.net/project/showfiles.php?group_id=7322">http://sourceforge.net/project/showfiles.php?group_id=7322</a>. For these instructions, we will assume this has been downloaded to the /tmp directory and is called /tmp/jboss-3.2.1-jetty4.2.14.sar. <br/> </li> <li>The server should be stopped while performing these updates. While it can be done using hot deploy of services, there are some JBoss services that do not correctly implement dependencies and a full restart is needed. <br/> </li> <li>Remove old web container. This will be found in the deploy directory, which will be similar to $JBOSS_HOME/server/default/deploy. The name of the web service has changed several times, so remove all services with name matching:<pre> jbossweb.sar jbossweb-ejb.jar jbossweb-jetty.sar jbossweb-tomcat.sar jetty*.sar jboss-X.X.X-jetty-X.X.X.sar jbossjetty.sar </pre> These files are often directories, in which case the whole hierarchy needs to be removed. You may wish to simply move these files out of the deploy directory, so that they may be later restored. <br/> </li> <li> Deploy the new JBoss Jetty service archive. This can be done simply by copying the sar into the deploy directory:<pre> cp /tmp/jboss-3.2.1-jetty4.2.14.sar $JBOSS_HOME/server/default/deploy </pre> However, as the configuration files are part of the sar, it is often desirable to deploy unpacked with the following commands:<pre> mkdir $JBOSS_HOME/server/default/deploy/jbossjetty.sar cd $JBOSS_HOME/server/default/deploy/jbossjetty.sar jar xf /tmp/jboss-3.2.1-jetty4.2.14.sar </pre> <br/></li> <li>If multiple JBoss configurations are used, their deploy directories must be updated in similar fashion. This normally means doing the same updates to $JBOSS_HOME/server/all/deploy <br/> </li> <li>Configure the Jetty server by editing the configuration files within the sar:<pre> jbossjetty.sar/META-INF/jboss-service.xml jbossjetty.sar/webdefault.xml </pre> <br/></li> <li> Restart the JBoss server <br/> </li> </ol> <h3>Jetty 5 and JBoss 3</h3> The Jetty 5 releases can be deployed with JBoss 3, thus giving access to the 2.4 servlet specification. There are some complications as the current JBoss releases have old xerces parsers and some JSPs that do not work with the latest specification. Full instructions on how to do the update have been posted at: <a href="http://article.gmane.org/gmane.comp.java.jetty.general/4309/"> http://article.gmane.org/gmane.comp.java.jetty.general/4309/</a>