SECTION: 600-J2EE TITLE: JBoss QUESTION: Jetty JBoss Integration.

### Background

Jetty was the default web container for the JBoss 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.

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.

### Installing JBossJetty.sar

The following steps will allow you to update a JBoss release to use a JBossJetty.sar:

1. Down load the JBoss Jetty release that you require from http://sourceforge.net/project/showfiles.php?group_id=7322. 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.
2. 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.
3. 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:

         jbossweb.sar
         jbossweb-ejb.jar
         jbossweb-jetty.sar
         jbossweb-tomcat.sar
         jetty*.sar
         jboss-X.X.X-jetty-X.X.X.sar
         jbossjetty.sar

   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.
4. Deploy the new JBoss Jetty service archive. This can be done simply by copying the sar into the deploy directory:

         cp /tmp/jboss-3.2.1-jetty4.2.14.sar $JBOSS_HOME/server/default/deploy

   However, as the configuration files are part of the sar, it is often desirable to deploy unpacked with the following commands:

         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

5. 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
6. Configure the Jetty server by editing the configuration files within the sar:

         jbossjetty.sar/META-INF/jboss-service.xml
         jbossjetty.sar/webdefault.xml

7. Restart the JBoss server

### Jetty 5 and JBoss 3

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: http://article.gmane.org/gmane.comp.java.jetty.general/4309/