Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Anchortoptop
In this article will help you migrate servlets and JSPs deployed JBoss v4.0.05 5 to Apache Geronimo v1.1. This article is part of a series of migration articles covering different types of applications migration.

...

Servlets and JSPs implementation analysis Anchoranalysisanalysis

Servlets and JSPs implementations may vary from one application server to another. The purpose of this section is to provide servlets and JSPs specific feature-to-feature comparison between JBoss and Apache Geronimo so you can clearly identify the differences and plan accordingly before migration.

...

http://java.sun.com/products/servlet
http://java.sun.com/products/jsp

The differences

JBoss v4.0.05 5 supports only Tomcat v5.5, which is the default Web container. The embedded Tomcat service is the expanded SAR jbossweb-tomcat55.sar in the <jboss_home>/deploy directory. The web.xml file that provides a default configuration set for Web application is also found in this exapanded SAR directory structure.

...

The following table summarizes the differences between JBoss and Geronimo.

Feature

JBoss 4.0.055

Apache Geronimo

Deployment descriptor/plan

jboss-web.xml

geronimo-web.xml

Method of deployment

Copy the package (ear, war, rar or jar) to the deploy folder of the JBoss server <jboss_home>/server/<your_server_name>/deploy

Deployer tool available in server's bin directory
<geronimo_home>/bin. Deployment is also available through the Geronimo Administration Console. A third option is Hot deployment, which would be the equivalent to JBoss functionality

Web container

Apache Tomcat 5.5

Jetty and/or Apache Tomcat

Sample application Anchor applicationapplication

The College Fest application handles registration for events at a college festival. This is an extremely simple application that does not use any type of database. The College Fest application has the following four pages:

...

Back to Top

The JBoss enviroment Anchorjbossjboss

This section shows you how and where the sample JBoss reference environment was installed so you can map this scenario to your own implementation.

...

  1. Download and install JBoss v4.0.05 5 as explained in the product documentation guides. From now on the installation directory will be referred as <jboss_home>
  2. Create a copy of the default JBoss v4.0.05 5 application server. Copy recursively <jboss_home>/server/default to <jboss_home>/server/<your_server_name>
  3. Start a new server by running the run.sh -c <your_server_name> command from the <jboss_home>/bin directory.
  4. Once the server is started, you can verify that it is running by opening a Web browser and pointing it to this URL: http://localhost:8080Image Removed. You should see the JBoss Welcome window and be able to access the JBoss console.
  5. Once the application server is up and running, the next step is to install and configure all the remaining pre-requisite software required by the sample application. This step is described in the following section.

...

After extracting the zip file, a college_fest directory is created. Open the config/build.properties file and edit the properties to match your environment as shown in the following example:

...

...

...

This build script depends on Geronimo v1.1 or later version

In the college_fest directory you can find build.xml which has the build information for the both JBoss and Geronimo version of sample application. For this particular sample application the use the jboss-war target.

From command line, still within the college_fest directory type the following command:

ant war- jboss

With this command, Ant will use the targets defined in build.xml file to build the College Fest application for the JBoss server. The following example shows the definitions in build.xml file.

...

The war created by the ant build contains a JBoss specific deployment descriptor, the jboss-web.xml file in the WEB-INF directory of the WAR is shown in the following example.

...

...

Deploy the sample application

...

To test the application, open a Web browser and access the following URL:

http://localhost:8080/college_festImage Removed

You should see the Welcome screen where you can login with your name and college. When you enter your name, a college and click Submit you will see a message at the end on the page stating your name with a link to "Click here" to enter the site. Browse the site and check the options, at this point the College Fest application is configured and running.

Back to Top

The Geronimo enviroment Anchorgeronimogeronimo

Download and install Geronimo from the following URL:

http://geronimo.apache.org/downloads.htmlImage Removed

The release notes available there provide clear instructions on system requirements and how to install and start Geronimo. Throughout the rest of this article we will refer to the Geronimo installation directory as <geronimo_home>.

...

...

If you are planning to run JBoss and Geronimo on the same machine consider to change the default service ports on, at least, one of these servers.

...

Back to Top

Step-by-step migration Anchor migration migration

In order to migrate the College Fest application to Geronimo you need to replace the jboss-web.xml file with a geronimo-web.xml file which is the Geronimo specific descriptor file. The geronimo-web.xml file is located in the WEB-INF directory withing the college_fest directory structure. The Geronimo deployment plan geronimo-web.xml is illustrated in the following example.

...

Given that College Fest is a very simple application, the Geronimo deployment plan will also be very simple. Remember that this application does not use any database access nor has security configured. While reading other articles in the JBoss to Geronimo migration series, you will notice how the complexity of the deployment plan increases as the sample applications for the different migration scenarios also grow in complexity.

Last time you built the College Fest sample application it was configured for ant to use the jboss-war target. To Geronimo specific building for the sample application use war-geronimo target providing ant war- geronimo in a command prompt. It will create college_fest.war file under the college_fest/releases/geronimo folder.

...

Repeat the steps you did when testing the application on the JBoss environment.

Back to Top

Summary Anchorsummarysummary

This article has shown you how to migrate a simple Servlet and JSPs application, from JBoss to the Apache Geronimo application server. You followed step-by-step instructions to build the application, deploy and run it, and then migrate it to the Geronimo environment.

...