Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This article is organized in the following sections:

Servlets and JSPs implementation analysis
Anchor
implementation
implementation

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.

...

Apache Geronimo currently supports two Web containers: Jetty and Tomcat.

Jetty

Jetty is a 100% Java HTTP Server and Servlet Container. This means that you do not need to configure and run a separate Web server in order to use servlets and JSPs to generate dynamic content. Jetty is a fully featured Web server for static and dynamic content.

...

Each Jetty connector is a GBean, so the process of configuring a Jetty connector involves configuring a GBean.

Apache Tomcat

Apache Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.

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

The differences

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

...

Feature

JBoss v4

Apache Geronimo

Deployment descriptor/plan

jboss.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

Back to Top

Sample application
Anchor
sampleApp
sampleApp

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

...

The user access the Welcome page and enters user name and college. From there the user can see the list of available events. The user can access the details for each Event by clicking them from the list. From the Event details page the user can register for that particular event.

Application classes and JSP pages

The College Fest sample application consists of the following two servlets:

...

  • welcome.jsp - Displays the events list to the user so that s/he can choose on what event to register.
  • dc.jsp - Displays the details for the Dumb Charades event.
  • pp.jsp - Displays the details for the Pot Potpourri event.
  • wtgw.jsp - Displays the details for the What's The Good Word event.
  • gq.jsp - Displays the details for the General Quiz event.
  • team_reg.jsp - Handles the user registration for one event.

Tools used

The tools used for developing and building the College Fest sample application are:

Eclipse

The Eclipse IDE was used for development of the sample application. This is a very powerful and popular open source development tool. Integration plug-ins are available for both JBoss and Geronimo. Eclipse can be downloaded from the following URL:
http://www.eclipse.org

Apache Ant

Ant is a pure Java build tool. It is used for building the war files for the College Fest application. Ant can be downloaded from the following URL:
http://ant.apache.org

Back to Top

The JBoss environment
Anchor
JBoss
JBoss

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

...

Apache Ant can be downloaded from the following URL:

http://ant.apache.org

Build the sample application

The College Fest application included with this article provides an Ant script that you will use in order to build the application. Download the College Fest application from the following link:

...

Code Block
xml
xml
borderStylesolid
titleJBoss deployment descriptor
<?xml version="1.0" encoding="UTF-8"?>

<jboss-web>

    <context-root>college_fest</context-root>
    <context-priority-classloader>
      false
    </context-priority-classloader>
</jboss-web>

Back to Top

Deploy the sample application

The previous step showed how to deploy the application at build time by specifying a customized jboss-build.xml file. If you used the default build.xml file at build time you still need to deploy the College Fest application manually. To deploy the College Fest application in JBoss, copy the college_fest.war file you just built with Ant to the following directory:

...

If JBoss is already started, it will automatically deploy and start the application; otherwise, the application will be deployed and started at the next startup.

Back to Top

Testing the application
Anchor
test
test

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

...

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 environment
Anchor
Geronimo
Geronimo

Download and install Geronimo from the following URL:

...

Warning
titleTCP/IP ports conflict

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.

...

Earlier in this article it was discussed the behavior of the deployment tool. During the deployment process, you provide to the deployment tool the application module and a deployment plan. The College Fest sample application is so simple that you may choose not to provide any deployment plan and let Geronimo do the deployment with a default set of values (a default context root for example).

...

To delete the generated files for a clean build run ant clean followed by an ant.

Back to Top

Deploy the migrated sample application

To deploy the migrated College Fest application, make sure the Geronimo server is up and running.

...

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

Back to Top

Summary
Anchor
summary
summary

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.

...