Copyright © 2004 Pearson Education, Inc.
Abstract
This book is an introduction to installing and configuring the Apache Geronimo application server, and then configuring and deploying applications to Geronimo. It is aimed at developers with prior J2EE experience, and basic knowledge of at least one other application server product. While some of the advanced topics cover specialized deployment scenarios, in general, this book is not aimed at system administrators.
Table of Contents
List of Figures
List of Tables
List of Examples
This book is an introduction to the Apache Geronimo application server. Currently Geronimo is under active development, and has not yet reached an feature-complete release. Milestone releases are made available periodically, as new features are added and the current version seems relatively stable.
The book covers a mix of current and upcoming features. Each chapter indicates which milestone release it applies to:
This chapter was last updated for the Milestone 4 release.
This chapter was writting using cutting-edge syntax some time after the Milestone 5 release. It is the closest possible to the 1.0 syntax. It should need only minor updates to be accurate for the Geronimo 1.0 release.
To try out features that are not yet available in a milestone release, you'll need to build Geronimo from source (or contact the author for a build).
![]() | Tip |
|---|---|
It is actually possible to run many J2EE applications in Geronimo today. Certainly the latest milestone release is good enough to start "playing around" with the server. However, tools and deployment plan formats are still subject to change. |
All code in this book is (or will be) formatted with a line width of no more than 65 characters. In some cases, particularly involving long class name, this makes for illegal or silly-looking code, such as:
import org.apache.geronimo.security.realm.providers.
PropertiesFileSecurityRealm;
Please bear with me, and remember that if you copy and paste Java or XML code samples from the book into real code, you may have to remove the occasional line break. In particular, anything within double-quotes that's split across two lines should be combined into one.
Thanks to Erin Mulder, Craig Johannsen, John Sisson, David Jencks, and Bruce Snyder for feedback on the online draft.
Thanks to Greg Hinkle, Rob Butler, and James Holmes for detailed reviews of the draft.
Thanks to Alan Cabrera for extensive help understanding the security implementation, and to David Jencks for extensive help understanding the connectors implementatation.
Thanks to XMLmind for an outstanding free DocBook editor that I used to write this book.
Thanks to Altova for XMLSpy, which I used to generate the diagrams of the XML Schemas in this book.
Table of Contents
Table of Contents
Geronimo is a free, open source J2EE™ application server. It comes with everything you need to run standard J2EE applications developed against the J2EE 1.4 specifications, and it is also backward-compatible to J2EE 1.3 and J2EE 1.2. Furthermore, its modular design makes it easy to customize, extend, or replace core server features. And thanks to the open source license, you can download the source code for troubleshooting, to help develop enhancements, or just as a matter of record.
At heart, the Geronimo architecture consists of a small core, and many services loaded on top of that core. Application components and resources are in turn loaded into the services. There are several advantages to this layered approach:
It is possible to configure a very compact server, running only the services, resources, and applications that are strictly necessary.
It is easy to add new custom services to the server environment, which can be configured, managed, and accessed by applications just like the default services.
It's possible to replace the default implementation of any service with an alternative, so long as it implements the same interfaces.
Since the Geronimo 1.1 release, Geronimo includes the Geronimo Plugin system used to build and distribute Geronimo applications and services. Plugins can be installed at runtime and handle dependencies and prerequisites automatically, to make it as easy as possible to install and use new features. Currently available plugins integrate Geronimo with other open source projects, and offer new capabilities to J2EE applications running in Geronimo.
Geronimo provides all the capabilities required by the J2EE 1.4 specification. In particular:
Geronimo includes a web application container supporting J2EE web applications. The web container itself supports basic configuration such as network ports and SSL options, and each web application WAR may include Geronimo-specific configuration information as well. Web applications participate in the Geronimo security infrastructure, so authenticating to a web application allows access to secure EJBs and Connectors as well.
Geronimo includes an EJB container supporting Session, Entity, and Message-Driven beans, including new J2EE 1.4 features such as Web Services and the EJB Timer service. It is also backward-compatible and supports EJB 2.0 applications. EJBs can be accessed both within the same application and by remote clients (over RMI or IIOP). An EJB JAR may include Geronimo-specific configuration information in addition to the standard J2EE deployment descriptor.
Geronimo includes a Connector container supporting both inbound and outbound Resource Adapters. Outbound connectors are the typical gateways to enterprise information systems, while inbound connectors allow external systems to deliver asynchronous messages to Message-Driven EJBs running in Geronimo. Connectors can be deployed as part of the server configuration (available to all applications) or as part of a specific application's configuration. A Connector RAR may include Geronimo-specific configuration information in addition to the standard J2EE deployment descriptor. Geronimo is also backward-compatible and supports J2EE Connector 1.0 Resource Adapters.
Geronimo provides a client container for running application clients in a managed environment. This allows a client application to access all the resources in the server environment using the same JNDI environment mapping techniques available to other application modules. All communication with the server is transparent to the application, minimizing the amount of custom code required. An application client may include Geronimo-specific configuration information in addition to the standard J2EE deployment descriptor.
Geronimo supports packaging all of the module types listed above into a single EAR file per application. Applications can be customized to configure and deploy specific Geronimo services when the application itself is deployed. Application dependencies can also be expressed, making it easier to handle groups of related applications.
Geronimo provides database connection pools for standard JDBC drivers. Database connection pools can be deployed as part of the server configuration or as part of a specific application's configuration.
Geronimo provides JMS connection factories and destinations. JMS resources can be deployed as part of the server configuration or as part of a specific application's configuration. The JMS provider may be configured for in-memory operation for maximum performance, or it may use clustering or persistent storage for enhanced reliability.
Geronimo provides JavaMail sessions allowing an application to send or receive e-mail (though as of v1.0 third-party transport plugins are required for POP and IMAP support).
Geronimo allows you to plug in a variety of security realm implementations, including file, LDAP, and database sources for authentication and authorization information. All the application modules can take advantage of this common security infrastructure.
The Geronimo infrastructure leverages JMX for configuration and management. If anything, looking at a running Geronimo server with a JMX client will probably show more JMX objects than you know what to do with, but is does provide extensive configuration and management options.
Building on the JMX foundation of Geronimo, the server and all application modules are exposed via the Management EJB. The J2EE management API includes a detailed object model for the manageable components in an application server, but does not detail the information or functions available for each component. Geronimo exposes robust management features for each managed component (including application modules, JDBC, JMS, and JavaMail resources, etc.).
Working in conjunction with the management API, the deployment API allows new application modules to be configured, deployed, started, stopped, redeployed, etc. All Geronimo-specific application configuration can be performed through the deployment API, and then the fully-configured application modules can be deployed to the server.
Geronimo supports both user-managed and container-managed transactions.
Geronimo includes the required JAXP, JAX-RPC, JAXR, and SAAJ APIs for XML, SOAP, and Web Services. Geronimo provides full Web Services support for J2EE components, including the ability to map and invoke external Web Services as well as the ability to expose certain application modules as Web Services.
In addition to the J2EE features listed above, Geronimo supports a number of extensions to the J2EE specification, both internally and via Geronimo Plugins. These include:
Geronimo applications can refer to common JARs installed in the Geronimo repository or included in the Geronimo shared library directory. This makes it easy to reduce the footprint of application modules and share JARs across multiple applications. Geronimo applications can also customize which classes are exposed from parent class loaders, and configure the parent/child class loading priority.
The Geronimo J2EE distribution includes a web-based administration console, including configuration options (such as network ports), wizards (to create database pools, security realms, etc.), monitoring screens (for thread pools and memory usage), deployment tools, and more. Certain plugins extend the administration console as well.
Geronimo supports clustering of web applications for fail-over and scalability.
The Apache Directory LDAP server can be run within Geronimo.
The Quartz scheduler can be run inside Geronimo, and scheduled jobs can be deployed as standalone modules or as part of J2EE applications.
The Liferay enterprise portal can by run inside Geronimo.
For cases where a full J2EE server is not needed, the Little G distribution offers a web-focused distribution with the same foundation as the full Geronimo server, but a much smaller footprint. Little G includes a web container, transaction manager, database connection pools, the same security, logging, and deployment tools, the Geronimo Plugin system, and more. However it omits support for EJBs, JMS, Web Services, and the administration console. If you need more than Little G, you can either add back features like JMS using Geronimo Plugins, or start with the J2EE distribution and simple disable or remove the features you don't need.
Geronimo developers can integrate Geronimo into Eclipse using the Geronimo Eclipse plugin. Leveraging the Eclipse Web Tools Project, this plugin lets you run Geronimo in Eclipse (including starting, stopping, deploying to, and debugging Geronimo), generate code for Geronimo, debug into JSPs running in Geronimo, and more.
Geronimo provides plugins for Maven 1, which can be used to start and stop Geronimo, deploy applications to Geronimo, build Geronimo Plugins, and more. With these plugins, a Maven build can compile and build an application, start Geronimo, deploy the application, run a number of tests, and finally shut down the Geronimo server. Maven 2 plugins are under development for the next release of Geronimo.
In addition, many other products can be integrated with Geronimo or run on Geronimo, even if they are not yet released as Geronimo Plugins. For example, products such as the Mule and ServiceMix ESBs currently work with Geronimo, with plugin releases planned.
Geronimo is a product of the Apache Software Foundation. As an open source product, Geronimo is developed, enhanced, and maintained by a group of Apache developers, and made available to others under the terms of the Apache Software License. Most Geronimo business is conducted in open forums, including mailing lists and an IRC channel for user and developer discussions, a public issue tracker for bugs and new features, and a Wiki for (among other things) recording tips and tricks for new users.
While the open source development process can be an advantage for some users -- you never need to wonder who's assigned to a bug, what progress is being made, and whether a fix will be made available to you -- it can be a disadvantage if you're looking for a more rigorous level of support. For that reason, multiple outside vendors offer support contracts for Geronimo with the full support of the Geronimo development team.
Another aspect of the Apache license is that Geronimo may be included in commercial products, such as higher-level servers, development tools requiring a working application server for testing, and more. In such cases the product vendor would typically provide support, though again, the Geronimo team encourages embedded use of this nature.
Many people have asked, "why does the world need another application server?" After all there are numerous application servers already, many very capable products, several relatively inexpensive products, and even two other application servers that are J2EE certified -- JOnAS and JBoss.
There are several key answers to this question.
One important answer is that there's still room left for innovation in the Application Server market. Many current application server providers have stopped enhancing their core application servers, focusing instead on other products such as portals and integration platforms. The Geronimo team believes that the application server space is not dead, and there is plenty of room left for innovation. We'd rather build a newer and better application server, and integrate with other projects that provide features like portals and ESBs.
As a specific example of this principle, Geronimo has been built to be modular and configurable to a greater degree than other available application servers. A key aim of Geronimo is to support custom "builds" or distributions of the server, tightly customized to the needs of a specific application or deployment scenario. The core J2EE application server is created by assembling a group from over 40 distinct configuration modules. But for applications with different needs, servers can be assembled from a smaller group of components, or including additional third-party components. The Geronimo Plugin system allows new features to be downloaded and installed or updated at runtime, and it can also be used to copy applications or services from one Geronimo server to another (to get a new developer's environment up immediately, to migrate an application from test to production, or to clone features across a farm of servers).
Another answer to this question is the Apache license. As an open source product, Geronimo is clearly in the same playing field as JBoss and JOnAS. However, both of those projects use the Lesser General Public License, or LGPL. While the exact effect of the LGPL as it applies to Java is subject to interpretation, one thing is clear. Changes to the core product, or products derived from the core product, must also be released as open source under the terms of the LGPL. The common interpretation of the LGPL is that a J2EE application can safely run on JBoss or JOnAS without being considered a derived work. But many development tools and server products could benefit from building on a certified application server, and those often require enough custom interaction with the application server that they may well be considered derived works. It's no surprise that most commercial products like portal servers and integration servers are built on top of proprietary application servers.
In the future, just like some vendors have built proprietary servers which tightly integrate the Apache web server or the Tomcat web container, the Apache license will allow proprietary products to be built using Geronimo as a fundamental building block. The next natural question is, "why would you want some big company to profit from your hard work?" There are many answers to this too, but a key point is that many companies who use and profit from open source servers contribute back to the open source projects. In fact, the first commercial product based on Geronimo has already been released, and the company behind it supports several developers working on the Geronimo project. In other words, each product built on Geronimo looks like a success story, not a hurdle.
License aside, Geronimo is intended to scale in a way few open source products have really explored. Many open source projects are very accessible to developers, but fall short when it comes to high-end production configurations. Clustering support tends to be limited in scalability, and most open source products are very limited when it comes to management and deployment in 24/7 configurations. Integration packages for standard third-party systems such as accounting and ERP systems are typically targeted strictly at proprietary application servers. All of these hurdles need to be overcome, without losing the core ease-of-development features that attracted a following in the first place.
Geronimo will ultimately address these issues, supporting ISPs, high-load Internet-facing web applications, and other applications ranging from small to very, very large. Of course, talk is cheap, and the 1.1 release of Geronimo doesn't include all the features on this list. Still, the Geronimo team members have developed and supported applications in these mission-critical environments, and this goal has been and will continue to be an important one in the ongoing development of Geronimo.
Geronimo was started in the summer of 2003, by a new community formed by current and past contributors to projects like JBoss, OpenEJB, Jetty, Castor, and more. It originally started in the Apache Incubator, a home for projects that might one day become full Apache projects.
In late 2003, the Apache Software Foundation became the first open source licensee of the J2EE TCK for certification purposes. Geronimo is one of the Apache projects interested in TCK access. TCK testing of Geronimo began in 2004.
In May of 2004, the Geronimo project exited the Incubator and became a top-level Apache project.
In June 2005, the automated TCK test suite was passed in full for the first time.
After 5 milestone releases, Geronimo 1.0 was released in January 2006. The initial release is J2EE certified and feature-complete as far as core J2EE features go. Some ease of use features are still under active development, including the management console and IDE integration, and others are on the horizon including EJB3 support, but we're proud of our first full release and plan to continue to work hard to improve it.
In June 2006, Geronimo 1.1 was released, including the Geronimo Plugin system, administration console enhancements, and many other fixes and improvements.
Geronimo consists of a set of core features and services as well as a number of critical services provided by other open source products. This is a list of many of those related projects.
The EJB container used by Geronimo
One of the available web containers for Geronimo
One of the available web containers for Geronimo
The JMS provider used by Geronimo
Provides database connection pool adapters in Geronimo, as well as the EJB CMP engine
Provides transaction logging and recovery for Geronimo
These are a selection of the projects that Geronimo depends upon.
Web Services features
Bytecode manipulation library
Utility classes for concurrency
http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html
Embedded database
A number of separate libraries offering common utility functions
The JMX engine that Geronimo is built on
Used by several included web applications (debug console, etc.), as well as the Geronimo build and packaging process
XML binding library used to read and write deployment descriptors and configuration files
Table of Contents
Geronimo can be freely downloaded and installed from the project home page on the Internet. This chapter discusses the download process, and then takes a quick tour of installing and starting Geronimo, connecting to the management console, deploying a database connection pool, setting up a security realm, and deploying an application.
Geronimo releases are available from the Geronimo web site:
http://geronimo.apache.org/downloads.html
There are three types of downloads available for each release:
J2EE Binary Release -- a
.tar.gz or .zip package that can be unpacked to
produce a working Geronimo installation, ready to run with default
settings. This release includes a full J2EE-certified distribution of
Geronimo. Generally the .tar.gz packages are best
suited for Mac or UNIX platforms, while the .zip
packages are best suited for Windows platforms.
Little G Binary Release -- a
.tar.gz or .zip package that can be unpacked to
produce a working Geronimo installation, ready to run with default
settings. This release does not include a full
J2EE stack -- it is lighter-weight and focused on supporting web
applications. While it includes many of the same elements as the J2EE
release, it omits EJB, JMS, Web Services, and CORBA support, as well
as the administration console. (Some of these individual features can
be added back using Geronimo Plugins.) Generally the
.tar.gz packages are best suited for Mac or UNIX
platforms, while the .zip packages are best
suited for Windows platforms.
Source Code -- a .tar.gz or .zip package with the source code for
Geronimo (and in some cases, closely related projects such as
OpenEJB). The Geronimo release can be rebuilt completely from the
provided source code, though the build scripts require a Maven
installation and a Java 1.4.2 development kit.
The binary releases are offered with two distinct configurations. Each configuration uses a different web container in Geronimo. The available web containers are:
Jetty Web Container
Tomcat Web Container
The Geronimo team fully supports both web containers, and does not have a preference for one or the other. We have people working hard to ensure that both are well-integrated into Geronimo. For straight J2EE applications, either container will work well. Some more advanced configurations do expose differences between the two web containers -- one area of note being how they handle virtual hosting. And some developers may have an existing preference. In any case, Geronimo uses a standard web deployment plan for both containers, and minimizes any differences visible to applications and developers.
![]() | Note |
|---|---|
To further clarify on Virtual Hosts, Tomcat configures each host separately with listen addresses, etc. and then can assign web applications to hosts in the deployment plan for an application. Jetty simple allows the developer to specify a list of virtual hosts in the deployment plan for an application. |
In order to get a version of Geronimo more current that the latest release, the source code can be checked out from Subversion, the version-control system used for Geronimo. Then the Geronimo build scripts can be used to create a custom distribution of Geronimo, using the same procedure as to build from an official source code release. The tools required to check out and build Geronimo include:
A Java Development Kit, version 1.4.2
Apache Maven 1.x, in order to download dependencies and build Geronimo (Maven 2.x for Geronimo 1.2 and higher)
A Subversion 1.x client, in order to check out the source code
The source code can be checked with a command like this:
svn co https://svn.apache.org/repos/asf/geronimo/trunk geronimo
This will create a new directory called geronimo containing the Geronimo source
code. From there, you can run various Maven commands to download
dependencies, build Geronimo and the projects it requires, run tests,
etc. This process is documented in greater detail on the Geronimo Wiki
(http://wiki.apache.org/geronimo/Building).
Once Geronimo has been built from source, the directories under
geronimo/modules/assemblies/
contain the same files that would ordinarily be present in the various
release options (typically under a target/geronimo-
subdirectory). That directory can be copied elsewhere and generally
treated similarly to a release.version/
This section gives a fast-paced walkthrough of a simple installation and customization process for Geronimo. Each of the steps here is covered in more detail in subsequent chapters.
To begin with, download the .tar.gz or .zip package.
Unpack the Geronimo install package to create a new geronimo-1.1/ installation directory. On
Windows, a tool like WinZip can be used to unpack the ZIP file. On Mac
or Linux, a command like tar -xzvf
geronimo-jetty-j2ee-1.1.tar.gz can be used to unpack the TAR
file. This results in the directory structure shown in Figure 2.1, “Quick Start: Install Directory” (see Chapter 3, Installing Geronimo [DRAFT (1.1)] for more details).
Open a command prompt and change to the Geronimo installation
directory. Make sure Java 1.4.2 or Java 5 is on the current PATH. To
start the server, run the command java -jar
bin/server.jar (see Section 3.4, “Starting the Server”
for more details).
Figure 2.2. Quick Start: Startup Output
geronimo-1.1> java -jar bin/server.jar
Booting Geronimo Kernel (in Java 1.5.0_07)...
Starting Geronimo Application Server v1.1
[************************] 100% 25s Startup complete
Listening on Ports:
1099 0.0.0.0 RMI Naming
1527 0.0.0.0 Derby Connector
4201 0.0.0.0 ActiveIO Connector EJB
4242 0.0.0.0 Remote Login Listener
8009 0.0.0.0 Jetty Connector AJP13
8080 0.0.0.0 Jetty Connector HTTP
8443 0.0.0.0 Jetty Connector HTTPS
9999 0.0.0.0 JMX Remoting Connector
61616 0.0.0.0 ActiveMQ Message Broker Connector
Started Application Modules:
EAR: geronimo/webconsole-jetty/1.1/car
RAR: geronimo/activemq/1.1/car
RAR: geronimo/system-database/1.1/car
WAR: geronimo/remote-deploy-jetty/1.1/car
WAR: geronimo/welcome-jetty/1.1/car
Web Applications:
http://remus:8080/
http://remus:8080/console
http://remus:8080/console-standard
http://remus:8080/remote-deploy
Geronimo Application Server startedGeronimo shows a text-based progress bar while it's starting, followed by a list of network ports it's listening on, applications that were started, and URLs to web applications that were started.
The ports in Figure 2.2, “Quick Start: Startup Output” are the
standard set for Geronimo. If any of them are already taken by other
programs (for example, 8080 for Tomcat), stop Geronimo, edit the file
var/config/config.xml and search for the port
number that's a problem, replace it with a new port number, and start
Geronimo again (see Chapter 5, Core Configuration [EMPTY] for more details).
Figure 2.3, “Quick Start: Editing Ports in config.xml” shows a section of
config.xml where the standard HTTP listen port of
8080 has been changed to 8180.
Once Geronimo has started, point a web browser to http://localhost:8080/console
(or use the host name for the machine Geronimo is installed on, if not
localhost). This brings up the login screen for the
Geronimo management console:
Enter the username "system" and password "manager". The default
administrator account is set in the files
var/security/users.properties and
var/security/groups.properties in the Geronimo
installation (see Chapter 9, Security Configuration [DRAFT (1.0)] for more details). Hit the
button to start the console.
The console has navigation options on the left, and a content area on the right.
To create a new database pool, Geronimo needs a JDBC driver. Geronimo ships with a JDBC driver for its embedded Apache Derby database, and can automatically download JDBC drivers for several popular open source databases (such as MySQL and PostgreSQL). For this quick start, we'll assume you create a Derby database pool, but you can also try configuring a pool pointing to a database of your own if you like (see Chapter 6, Database Configuration [DRAFT (1.1)] for more details on creating custom database pools).
![]() | Tip |
|---|---|
If you need to manually install a JDBC driver, create a
directory named for the product under the |
To create a new Derby database:
Select in the navigation bar on the left.
Enter TestDatabase in the Create DB field, and click the button.
Make sure TestDatabase is listed in the
Database List at the top of the screen.
To create a new database pool:
Select in the navigation bar on the left.
Select the create pool link shown in Figure 2.5, “Quick Start: Database Pools”.
Enter TestPool in the Name of Database Pool field, and select the database product from the Database Type drop-down (select Derby Embedded if you don't have a database of your own to connect to). Click the button to continue.
Select the Driver JAR for your database.
The drop-down shows encoded names for third-party JARs located in
the repository/ directory of
the Geronimo installation. For Derby, select
org.apache.derby/derby/10.1.1.0/jar as the
driver JAR. (If the server has Internet access and is not behind an
HTML proxy server, you can use the button to automatically download many open source
database drivers.)
Enter other connection parameters to connect to the database. Many databases require a server name, database name, username, and password. (The embedded Derby driver does not require the server name, as it's always running in the same VM as the application server. You can also leave the username and password blank, though you should set the database name to, for example, TestDatabase.) Click the button to continue.
On the next page, review the JDBC Connect URL that was generated, and if it looks okay, click to try to connect to the database. If there are any problems, use the button to correct them, or else use the button to deploy the new database pool.
![]() | Tip |
|---|---|
Instead of creating the database in advance using the DB
Manager, you can add |
After creating the database pool, run the following SQL script to create sample tables to use to create a SQL security realm:
create table TEST_USER (
username varchar(20) not null primary key,
password varchar(20) not null,
name varchar(50));
create table TEST_USER_GROUPS (
username varchar(20) not null,
group_name varchar(20) not null,
primary key (username, group_name));
insert into TEST_USER values ('jdoe','secret','John Doe');
insert into TEST_USER_GROUPS values ('jdoe','Employees');
insert into TEST_USER_GROUPS values ('jdoe','Administrators');![]() | Tip |
|---|---|
If you're using the embedded Derby database, you can select the entry in the console to run the SQL script. Select TestDatabase under Use DB, paste the script above into the SQL Command/s window, and then click . |
The next step is to create a sample security realm. We'll create a SQL security realm based on the database pool created above (for more details on creating security realms, see Chapter 9, Security Configuration [DRAFT (1.0)]). To create the new SQL security realm:
Select from the navigation area on the left side.
Click the link to .
Enter TestRealm for the Name of Security Realm and select Database (SQL) Realm as the Realm Type. Click to continue.
Set the User SELECT SQL to select username, password from TEST_USER where username=? and set the Group SELECT SQL to select username, group_name from TEST_USER_GROUPS where username=?
Select TestPool (or whatever you called the database pool above) as the Database Pool and click to continue (the other settings on this page are only used if no database pool is specified).
Click to make sure the realm is configured correctly.
If you used the script above, enter jdoe as the Username and secret as the Password and click to test the login.
If you used the script above and the jdoe login, the next
screen should show that 3 principals were generated, one
GeronimoUserPrincipal with name
jdoe, one
GeronimoGroupPrincipal with name
Employees, and one
GeronimoGroupPrincipal with name
Administrators.
Click to deploy the new security realm.
This step walks through deploying a very simple web application (no additional configuration required), as well as a secure web application that needs to be hooked up to the security realm created in the previous step. If you have a simple web application (with no EJB references or resource references, etc.) to use as a test, you can try that (more details on the deployment options can be found in Chapter 10, Development & Deployment Overview [DRAFT (1.0)]), you can try that (and likewise, a simple web application that uses security but no resource references).
Otherwise, you can download a copy of the Geronimo Welcome web application and the Geronimo LDAP Demo web application (basically the same as you'd see at http://localhost:8080/ and http://localhost:8080/ldap-demo/ for a typical Geronimo install). The welcome application has no security and can be deployed as-is, while the LDAP demo application uses security so we can test the security realm created above. These applications are available at: http://people.apache.org/repository/geronimo/wars/geronimo-welcome-1.1-SNAPSHOT.war and http://people.apache.org/repository/geronimo/wars/geronimo-ldap-demo-1.1-SNAPSHOT.war.
First, you can try deploying the Welcome application with no additional Geronimo customization:
java -jar bin/deployer.jar deploy \
geronimo-welcome-1.1-SNAPSHOT.warTo make sure this is running, try connecting to http://localhost:8080/geronimo-welcome-1.1-SNAPSHOT/. This is a very small web application, so if the page comes up at all, then it worked (and that's all there is to see).
Next, create a geronimo-web.xml deployment
plan that configures a custom URL prefix and security for the LDAP Demo
web application. This web application is normally used to demonstrate
the functionality of an LDAP security realm, but will work just as well
to demonstrate the test realm created above. The plan should look like
this (and see Chapter 11, Web Applications (WARs) [DRAFT (1.1)] for more details on the web
application Geronimo deployment plan):
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
<environment>
<moduleId>
<artifactId>TestWebApplication</artifactId>
</moduleId>
</environment>
<context-root>/test-web</context-root>
<security-realm-name>TestRealm</security-realm-name>
<security>
<default-principal>
<principal name="anonymous" class="org.
apache.geronimo.security.realm.providers.GeronimoUserPrincipal"
/>
</default-principal>
<role-mappings>
<role role-name="content-administrator">
<principal name="Administrators" class="org.
apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"
/>
</role>
</role-mappings>
</security>
</web-app>This plan:
Sets the web application to appear at a URL starting with
/test-web
Sets the security system to run any logins against the
TestRealm security realm.
Sets the default principal to a user named "anonymous" for
pages where security is not required but the page still calls
HttpServletRequest.getUserPrincipal.
Maps all users in the "Administrators" group in the security realm to the "content-administrators" J2EE role (which is declared in the web.xml for the LDAP Demo realm).
![]() | Warning |
|---|---|
Make sure to remove the whitespace in the principal class names in the plan listed above (2 places). The fully-qualified class names are only split across lines in that listing to fit the margins of the book -- they won't really work if entered that way. |
To deploy the LDAP demo web application with this plan, use a command like this:
java -jar bin/deployer.jar deploy \
geronimo-ldap-demp-1.1-SNAPSHOT.war geronimo-web.xmlTo test the security realm, try connecting to http://localhost:8080/test-web/. From the front page there, click the link to force a login (and use the username "jdoe" and password "secret" if you set up the sample security realm using the SQL in this quick start). You can also try the link to make sure that pages you can't access are properly rejected with a 403 error.
That's it for the quick start. If you followed the whole thing, you:
Downloaded Geronimo
Installed Geronimo
Changed any conflicting network ports
Tried out the Geronimo management console
Created a database connection pool
Created a security realm based on the test database pool
Deployed a simple web application requiring no customization
Deployed a more complex web application, customizing it to use the test database pool and security realm
Tried a login to make sure everything worked
If there are certain areas in the quick start that you want to investigate in more detail, you can follow the cross-references in the text. Otherwise, the following chapters will introduce you to each of the features of Geronimo in more depth.
Table of Contents
Geronimo is currently distributed as a simple ZIP or GZ archive (for Windows and Mac/Unix/Linux respectively). The installation process is simply a matter or unzipping the archive and verifying the installation. The basic distribution can also be customized, commonly to change the administrator account used for management, or to change the networks ports used (in case of a conflict with existing software on the machine such as Tomcat or JBoss).
![]() | Note |
|---|---|
This chapter assumes you have downloaded a release of Geronimo. If not, please see Chapter 2, Acquiring Geronimo & Quick Start [DRAFT (1.1)]. |
Geronimo is a pure-Java product, and should therefore run on any platform with the appropriate Java Virtual Machine.
As Geronimo implements J2EE 1.4, and J2EE 1.4 requires J2SE 1.4, Geronimo will run under Java 1.4 or higher. However, J2EE includes certain CORBA requirements, and the CORBA features currently used by Geronimo require a Sun 1.4.x JVM. That means the only J2EE Certified platform for Geronimo is currently the Sun 1.4.2 JVM. Broader certification across other JVM vendors and versions is a goal for future releases.
![]() | Tip |
|---|---|
Geronimo runs well on Java 5, so long as CORBA features are left disabled. If your applications require CORBA support, you'll need to use a Sun J2SE 1.4.2_* JVM. |
As far as operating systems go, Geronimo has been successfully run on many Windows, Mac, Linux, and UNIX platforms, including:
Windows 2000, XP, and 2003
Linux x86 (Debian, Red Hat, SuSE, Ubuntu, Mandriva, and Gentoo)
Linux x86_64 (SuSE)
Mac OS X
Solaris 8 and 10
HP-UX 11.0
Geronimo includes a bundled JSP compiler, which means it can actually run under the Java Runtime Environment (JRE), and does not require a Java Development Kit (JDK).
![]() | Tip |
|---|---|
Geronimo itself can run on a headless machine (that is, a server
with no windowing system or GUI available, such as some UNIX machines).
In many cases, even applications dealing with printing and graphics can
be run by starting Geronimo with the
|
The most expedient way to install a milestone release of Geronimo is
to download and unpack the .zip or
.tar.gz file. No additional steps
are necessary, and you will get a default, working configuration out of
the box.
On Windows platforms, use a tool like WinZip to open the .zip file and extract the Geronimo files.
This will create a new geronimo-1.1/ subdirectory containing all
the Geronimo files.
![]() | Warning |
|---|---|
Geronimo includes files with long paths and names, and Windows
limits all files to a total path length of 255 characters. This means
it's safest to install Geronimo into a directory with a very short
path name. For example, it would be best to use a path like |
On these platforms, use the UNIX tar tool to
open the .tar.gz file and extract
the Geronimo files. This will create a new geronimo-1.1/ subdirectory containing all
the Geronimo files. For example:
> tar -xzvf geronimo-jetty-j2ee-1.1.tar.gz geronimo-1.1/ geronimo-1.1/bin/ geronimo-1.1/docs/ geronimo-1.1/lib/ ...
All of the installation methods create the same final directory layout. The resulting Geronimo directory will look something like this:

The text files are informational only, and can be freely moved or removed. The directories are the interesting part:
Holds the JARs used to start the server and run the offline deploy tool
The hot deploy directory. You can copy applications here and Geronimo will try to deploy them automatically.
Presently, just holds a file pointing to the Geronimo web site for the documentation.
Holds libraries required to load the most basic parts of Geronimo -- the foundation (or "kernel") which in turn loads all the other application, resource, and service modules.
Holds applications and modules that can be run in Geronimo, as well as shared libraries which the application and modules can refer to. Not everything in this directory will be loaded -- each library will be loaded only when a module that uses it is loaded. You might add entries here for database drivers or libraries that should be visible to multiple application modules without being separately distributed with each application. The Geronimo deployment tools and the Geronimo plugin installer will automatically copy applications or modules into the repository when they are installed.
Holds a reference copy of the XML Schema definitions for all the J2EE and Geronimo deployment descriptors, as well as the definitions of all the Geronimo configuration files.
Holds some files pertaining to the runtime state of the server, such as configuration files, the default security realm, log files, the transaction log, etc.
None of these directories should be moved or altered. Only a limited number of files in them should even be edited (one example of an editable file is the properties file that configures users and password for the default security realm).