You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Tomcat as we all know is a Web Container available with Apache family of products. It implements Java Servlet 2.5 API and Java Server Pages 2.1 API. Apache Geronimo which is a Java EE5 certified application server which Apache Derby, Apache Active MQ, Apache AXIS, Apache Tomcat etc pre-integrated. As a result while working with Geronimo you will be working with same Tomcat engine as the standalone version of Tomcat. However there are some differences which we will discuss in upcoming sections

Implementation Analysis

While working with Geronimo you will be working with same Tomcat as the standalone Tomcat. This section will enlist the basic differences/similarities between Geronimo and Tomcat

  1. Both implements servlet 2.5 and JSP 2.1 API's.
  2. JNDI has to be configure manually in server.xml for Tomcat whereas in Geronimo,JNDI has access to all the object references managed by geronimo kernel.
  3. JMS is configured manually in server.xml for Tomcat whereas in Geronimo same can be achieved by GUI based Administrative Console.
  4. JDBC is configured manually in server.xml for Tomcat whereas in Geronimo same can be achieved by GUI based Administrative Console.
  5. web.xml is the default deployment descriptor for both the servers
  6. Geronimo has container specific deployment descriptor also know as deployment plans whereas Tomcat does not have any container specific deployment descriptor.

In geronimo most of the configuration can be done using the deployment plan geronimo-web.xml, config.xml or config-substitution.properties. Adding resources like JMS queues, connection factory, JDBC datasource etc can be easily achieved using web based Administrative console. This simplifies the configuration management versus the manual configuration done using server.xml and context.xml in Tomcat.

Best Practices

In order to overcome most migration related issues you need to figure out how each service is mapped within Tomcat and apply to Community Edition. We will enlist some scenarios in this regard

Tomcat only application

In this case you may have some servlet,jsp's added to your application. You may have also configured security realms, Tomcat specific features like JSP reloading etc.

    • Servlet and JSP's code will work equally well with Tomcat and Geronimo. So there are no modifications required on this part.
    • In Tomcat you may have configured security realms in server.xml, also a admin, manager roles can be added using tomcat-users.xml file. In geronimo same can be achieved by adding the following tags <security-realm-name>geronimo-admin</security-realm-name> <sec:security> </sec:security> in geronimo-web.xml(geronimo specific deployment descriptor also known as deployment plan). Users and Groups can be added to the default realm by using the Security => Console Realm menu from the Web console menu.

Tomcat and Apache Derby

For Tomcat to work with Apache Derby you have to download Apache Derby and configure environment variables like DERBY_INSTALL. You also need to make sure that the following jars are present in the classpath

      • lib/derby.jar
      • lib/derbytools.jar
      • lib/derbynet.jar
      • lib/derbyclient.jar
        To execute a sql command you have to use ij scipt which comes packaged with Apache Derby.

With regarda to Apache Geronimo there is no need for setting up environment variables or classpath. This is take care of by geronimo. Creating database table and database pool can be easily achieved by using web based Administrative Console. However you have to include a <dependency> </dependency> tag and <resource-ref> </resource-ref> tag in geronimo-web.xml so that the resources are visible to the deployed application.
All the other suggestions made in Tomcat only application is equally vaild in this scenario as well.

  • No labels