Background

Apache Geronimo is a full J2EE 1.4 certified application server that is completely open source and under the Apache Software License. Geronimo first passed the Technology Compatibility Kit(TCK) test in 2005 and v1.0 was released in January 2006. The Geronimo community is backed by over 30 committers from different companies and individuals.

Getting the software

There are currently two way to get the released software. You can either retrieve it from the Apache SVN repository or fhe fastest and easiest way is to get the binary directly from the Apache Geronimo site. Since this article is intended to help you to have Apache Geronimo up and running in the fastest possible way, only the binary download will be covered at this time.

Prerequisites

Although this installation path is the fastest one, still you will need to install some software before installing Geronimo.

J2SE 1.5

Geronimo is currently using the Sun ORB for RMI so it is required to use SUN JDK. Refer to the following URL for details on how to download and install J2SE 1.5:http://java.sun.com

Download binaries

Depending on the platform you plan to install and run Apache Geronimo you will select the appropriate installation image. Open a Web browser and access the following URL, there you will find the available packages for download (binaries and source code).

Apache Geronimo v1.2 is certified on J2EE 1.4 but it works with 1.5 as long as CORBA is not used.

Select the file compression format compatible with your system (zip, tar, gz) by clicking directly on the link, download it and expand the binary to your hard drive in a new directory. For example in z:/geronimo, from now on this directory will be referenced as <geronimo_home>.

The installation of Apache Geronimo is as simple as uncompressing the .zip or .tar files. The next step is to start the server.

Start the server

With Apache Geronimo already installed, open a command line console and change directory to <geronimo_home>/bin. In that directory you will find some script files (.bat and .sh) and several .jar files. If you look at these five files you will find:

client.jar

deployer.jar

jpa.jar

server.jar

shutdown.jar

These jar files can be launched by using java -jar to invoke the main class in <geronimo_home>/bin/<file.jar>
The client.jar file can be used to start the Geronimo configuration that contains the application client that you want to run.
The deployer.jar file is a Java application that manages J2EE artifacts and GBeans that run on the Geronimo server.
The jpa.jar file is for OpenJPA persistance support.
The server.jar file is used to start the Geronimo server.
The shutdown.jar file can be invoked from command line to shutdown the server.

Alternatively, the above mentioned files can also be started using their respective scripts.

To start the server run the following command:

java -jar server.jar

Alternatively a script is provided, the startup script will also start the server. Once the server is started you should see the following information on the command line console.

To test the Apache Geronimo server you can just point your Web browser to the following URL to test the Geronimo Console. The Geronimo Administration Console is the first application you can test, and the good thing is, it is already deployed in the standard, full J2EE certified distribution.

When prompted enter system as the user name and manager as the password.

The following figure illustrates the Web based console.

At this point you have Apache Geronimo up and running and the time spent has been minimal. The following section will propose a very basic sample JSP and show you how to deploy and run that sample application.

Create and deploy a sample application

A HelloWorld like JSP is almost a default for these basic testing and everybody is already familiar with it. Create a new directory to hold all the application related files. From now on this directory will be referred as <app_home>.

Create a plain text file in the <app_home> directory named HelloWorld.jsp and copy the content of the following example.

Although for such a simple application it is not necessary, we will still create a Geronimo deployment plan so you would get a first glimpse of the deployment plans. Create a directory named WEB-INF inside the <app_home> directory.

Create a plain text file in the <app_home>/WEB-INF directory named geronimo-web.xml and copy the content of the following example.

Geronimo deployment plan geronimo-web.xml

Create a plain text file in the <app_home>/WEB-INF directory named web.xml and copy the content of the following example.

Summary

This article showed you how simple is to have Apache Geronimo up and running. The overall time for getting the server running should be less than five minutes if you have the prerequisites already installed. Additionally, this article also showed you how to create, deploy and test a very simple JSP in less than five minutes.