If you are in a hurry to have Apache Geronimo up and running, this article can show you the basic steps of downloading, building (when needed) and running the server in a short time.
All you need is 5 to 10 minutes to follow these steps.
Getting the software
There are currently the following two ways to get the released software:
- Retrieve the source code from the Apache SVN repository.
- Download the binary files from the Apache Geronimo Web site.
This section only shows how to download the binary files from the Apache Geronimo Web site because this way is faster and easier than retrieving the source code from the Apache SVN repository.
Prerequisites
Before you install Geronimo, you must install the Java Runtime Environment (JRE) or Java Development Kit (JDK). JDK is only required for wsgen tools.
Installing Java SE 6
Apache Geronimo v3.0-M1 is a non-certified milestone release containing some Java EE 6 features and support for the OSGi programming model. For more information about how to download and install the latest Java SE 6 JRE or JDK, go here.
Geronimo 3.0-M1 is a milestone release and should only be used for learning about the upcoming Geronimo 3.0 release with Java EE 6 and OSGi/Aries support and not for any type of production usage.
Downloading binary files
You can go to http://geronimo.apache.org/downloads.html to download the available packages (binary files and source code). You must select the installation file according to the platform that you plan to install and run Apache Geronimo on.
Geronimo v3.0-M1 is available in the following three assembly configurations:
- Web Container releases : Java EE 6 web profile(not certified)
- Minimal (Little-G) : Web Container, Transaction, and Connector capabilities
- Framework : Geronimo kernel core functionality
In this section, we use the release with Tomcat Web container for demonstration. For more information about the difference between these three assembly configurations, see Getting and installing Geronimo.
You can download the installation file with the compression format (.zip or .tar.gz) that is compatible with your operating system by clicking the link on the website. To install Apache Geronimo, extract the binary files to a new directory on your hard disk, for example, d:/geronimo. In the rest of this section, this directory is referred to as <geronimo_home>.
Starting the server
To start Apache Geronimo:
- In the command-line interface, go to the <geronimo_home>/bin directory.
- Type the following command:
./geronimo run
The command starts the server within the command-line interface instead of in the background. When the server is started, you can see the following information.
Using GERONIMO_HOME: D:\geronimo Using GERONIMO_TMPDIR: var/temp Using JRE_HOME: C:\java-i386-60\jre ______ _ / ____/___ _________ ____ (_)____ ___ ____ / / __ / _ \/ ___/ __ \/ __ \/ // __ `__ \/ __ \ / /_/ // __/ / / /_/ / / / / // / / / / / /_/ / \____/ \___/_/ \____/_/ /_/_//_/ /_/ /_/\____/ Apache Geronimo (3.0-M1) Hit '<tab>' for a list of available commands and '[cmd] --help' for help on a specific command. Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Geronimo. geronimo> Booting Geronimo Kernel (in Java 1.6.0)... Module 1/36 org.apache.geronimo.framework/j2ee-system/3.0-M1/car started in .000s Module 2/36 org.apache.geronimo.framework/rmi-naming/3.0-M1/car started in .224s Module 3/36 org.apache.geronimo.framework/plugin/3.0-M1/car started in .146s Module 4/36 org.apache.geronimo.framework/j2ee-security/3.0-M1/car started in .250s Module 5/36 org.apache.geronimo.framework/server-security-config/3.0-M1/car started in .026s Module 6/36 org.apache.geronimo.framework/geronimo-gbean-deployer/3.0-M1/car started in .206s Module 7/36 org.apache.geronimo.configs/j2ee-server/3.0-M1/car started in .026s Module 8/36 org.apache.geronimo.configs/j2ee-deployer/3.0-M1/car started in .092s Module 9/36 org.apache.geronimo.configs/transaction-1_6/3.0-M1/car started in .212s Module 10/36 org.apache.geronimo.configs/connector-deployer-1_6/3.0-M1/car started in .083s Module 11/36 org.apache.geronimo.configs/jasper/3.0-M1/car started in .022s Module 12/36 org.apache.geronimo.configs/tomcat7/3.0-M1/car started in 1.175s Module 13/36 org.apache.geronimo.configs/tomcat7-deployer/3.0-M1/car started in .028s Module 14/36 org.apache.geronimo.configs/web-extender/3.0-M1/car started in .014s Module 15/36 org.apache.geronimo.configs/welcome-tomcat/3.0-M1/car started in .541s Module 16/36 org.apache.geronimo.configs/remote-deploy-tomcat/3.0-M1/car started in .431s Module 17/36 org.apache.geronimo.configs/jasper-deployer/3.0-M1/car started in .007s Module 18/36 org.apache.geronimo.configs/myfaces/3.0-M1/car started in .016s Module 19/36 org.apache.geronimo.configs/myfaces-deployer/3.0-M1/car started in .014s Module 20/36 org.apache.geronimo.configs/aries-deployer/3.0-M1/car started in .009s Module 21/36 org.apache.geronimo.configs/persistence-jpa20-deployer/3.0-M1/car started in .026s Module 22/36 org.apache.geronimo.configs/openjpa2/3.0-M1/car started in .004s Module 23/36 org.apache.geronimo.configs/system-database/3.0-M1/car started in 8.714s Module 24/36 org.apache.geronimo.configs/dojo-tomcat/3.0-M1/car started in .077s Module 25/36 org.apache.geronimo.plugins/pluto-support/3.0-M1/car started in .005s Module 26/36 org.apache.geronimo.plugins/console-tomcat/3.0-M1/car started in .872s Module 27/36 org.apache.geronimo.plugins/plugin-console-tomcat/3.0-M1/car started in .521s Module 28/36 org.apache.geronimo.configs/client-deployer/3.0-M1/car started in .029s Module 29/36 org.apache.geronimo.configs/webservices-common/3.0-M1/car started in .000s Module 30/36 org.apache.geronimo.configs/openejb/3.0-M1/car started in .674s Module 31/36 org.apache.geronimo.configs/openejb-deployer/3.0-M1/car started in .029s Module 32/36 org.apache.geronimo.configs/openejb-corba-deployer/3.0-M1/car started in .035s Module 33/36 org.apache.geronimo.configs/j2ee-corba-yoko/3.0-M1/car started in .308s Module 34/36 org.apache.geronimo.configs/activemq-broker-blueprint/3.0-M1/car started in .877s Module 35/36 org.apache.geronimo.configs/activemq-ra/3.0-M1/car started in .240s Module 36/36 org.apache.geronimo.configs/javamail/3.0-M1/car started in .026s Startup completed in 23.324s seconds Listening on Ports: 1050 127.0.0.1 CORBA Naming Service 1099 127.0.0.1 RMI Naming 1527 127.0.0.1 Derby Connector 2001 127.0.0.1 OpenEJB ORB Adapter 4201 127.0.0.1 OpenEJB Daemon 4203 127.0.0.1 OpenEJB Daemon 6142 239.255.3.2 OpenEJB Daemon 6882 127.0.0.1 OpenEJB ORB Adapter 8009 127.0.0.1 Tomcat Connector AJP TomcatAJPConnector 8080 127.0.0.1 Tomcat Connector HTTP BIO TomcatWebConnector 8443 127.0.0.1 Tomcat Connector HTTPS BIO TomcatWebSSLConnector 9999 127.0.0.1 JMX Remoting Connector Started Application Modules: EAR: org.apache.geronimo.plugins/console-tomcat/3.0-M1/car RAR: org.apache.geronimo.configs/activemq-ra/3.0-M1/car RAR: org.apache.geronimo.configs/system-database/3.0-M1/car WAR: org.apache.geronimo.configs/dojo-tomcat/3.0-M1/car WAR: org.apache.geronimo.configs/remote-deploy-tomcat/3.0-M1/car WAR: org.apache.geronimo.configs/welcome-tomcat/3.0-M1/car WAR: org.apache.geronimo.plugins/plugin-console-tomcat/3.0-M1/car Web Applications: / /console /console-base /dojo /plugin /remote-deploy Geronimo Application Server started
To verify that the Apache Geronimo server is running, go to http://localhost:8080/console to open the Geronimo administrative console. The Geronimo administrative console is the first application you can test. It is deployed in the standard, full Java EE certified distribution of Apache Geronimo.
When the Geronimo administrative console is open, enter system as the user name and manager as the password.
The following figure shows the Web-based Geronimo administrative console.
Now you have Apache Geronimo up and running. The following section shows you how to create, deploy, and run a sample JSP Web application on Apache Geronimo.
Creating and deploying a sample application
To create a HelloWorld JSP Web application:
- Create a new directory to hold all the application related files. In the rest of this section, this directory is referred to as <app_home>.
- In the <app_home> directory, create a plain text file named HelloWorld.jsp, and then copy the following code to this file.
Note: To save time, you can download HelloWorld.war file from this page.
<html> <head> <jsp:useBean id="datetime" class="java.util.Date"/> <title> Basic HelloWorld JSP </title> </head> <body bgcolor="#1276C2"> <h1> <font face="tahoma" color="white"> Hello world from GERONIMO! </font> </h1> <font face="tahoma" color="white">on ${datetime}</font> </body> </html>
To deploy an application, you must create a Geronimo specific deployment plan. To create the deployment plan for the sample application:
- Create a directory named WEB-INF in the <app_home> directory.
- In the <app_home>/WEB-INF directory, create a plain text file named geronimo-web.xml, and then copy the following code to this file.
Geronimo deployment plan geronimo-web.xml<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"> <environment> <moduleId> <groupId>org.apache.geronimo.samples</groupId> <artifactId>HelloWorldApp</artifactId> <version>1.0</version> <type>war</type> </moduleId> </environment> <context-root>/hello</context-root> </web-app>
- In the <app_home>/WEB-INF directory, create a plain text file named web.xml, and then copy the following code to this file.
web.xml<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <welcome-file-list> <welcome-file>HelloWorld.jsp</welcome-file> </welcome-file-list> </web-app>
Deploying and testing the application
In this example, we do not invest time in packaging the application. Instead, we use the --inPlace
feature of the deployer tool to deploy the application. You can use this feature to deploy an application from any directory.
To deploy the application:
- In the command-line interface, go to the <geronimo_home>/bin directory.
- Type the following command:
deploy --user system --password manager deploy --inPlace <app_home>
Note: As a quick alternative, the three files in this Hello World sample have been packaged into HelloWorld.war and attached to this page. To deploy it:
- Download HelloWorld.war to <war_home> on your system.
- Deploy it via:
deploy --user system --password manager deploy <war_home>/HelloWorld.war
When the application is successfully deployed, you can see the following message:
D:\geronimo\bin>deploy --user system --password manager deploy --inPlace \HelloWorld Using GERONIMO_HOME: D:\geronimo Using GERONIMO_TMPDIR: var\temp Using JRE_HOME: C:\java-i386-60\jre Deployed sample.applications/HelloWorldApp/1.0/war @ /hello
To test the application, go to http://localhost:8080/hello.
Stopping the server
In the command-line interface where the server is started, press CTRL+C to stop the server.
Summary
This article shows you how simple it is to have Apache Geronimo up and running. It takes less than five minutes to start the server if you have installed the prerequisites. Additionally, this article shows you how to create, deploy and test a simple JSP Web application in less than five minutes.