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 with 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.
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.
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, 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 two key answers to this question. One answer is, 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. This area will continue to be a focus for future versions of Geronimo, expanding to handle extracting customized components from a modified server and distributing them to other Geronimo servers in the environment.
A second 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 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.0 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.
Back to the original question, yet another motivation behind the founding of Geronimo is the Apache community. While some other projects are controlled by a single company or a small number of individuals, Apache projects are based on the principles of collaborative development, and Geronimo will never be subject to anyone's fiat. The key developers span numerous companies and continents, and all decisions are voted on and made in public forums, with the input of the community. You're welcome to join!
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 is expected to be released in December 2005. 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.
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:
Binary Release -- a .tar.gz or .zip package that can be unpacked to produce a working Geronimo installation, ready to run with default settings. Generally the .tar.gz packages are best suited for Mac or UNIX platforms, while the .zip packages are best suited for Windows platforms.
Installer Package -- an executable JAR. When run, it produces a Wizard-style installer interface, offering configuration options such as the network ports to use, the default administrator username and password, etc. Currently this is the most convenient way to change the administration account and network ports Geronimo listens on at installation time. The installer package can also be used to perform automated installations.
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 release is offered as two distinct configurations, and the same options are available through the installer. The option is related to the web container used by Geronimo
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
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-version/ subdirectory). That directory can be copied elsewhere and generally treated similarly to a release.
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.0/ 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-1.0-jetty.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 (M4)] for more details).
Open a command prompt and change to the Geronimo installation directory. Make sure Java 1.4.2 is on the current PATH. To start the server, run the command java -jar bin/server.jar (see Section 3.6, “Starting the Server” for more details).
Figure 2.2. Quick Start: Startup Output
geronimo-1.0> java -jar bin/server.jar
Booting Geronimo Kernel (in Java 1.4.2_10)...
Starting Geronimo Application Server
[*************************] 100% 37s Startup complete
Listening on Ports:
1099 0.0.0.0 RMI Naming
1389 0.0.0.0 Apache Directory LDAP
1527 0.0.0.0 Derby Connector
4201 0.0.0.0 ActiveIO Connector EJB
4242 0.0.0.0 Remote Login Listener
8019 127.0.0.1 Jetty Connector AJP13
8080 0.0.0.0 Jetty Connector HTTP
8443 0.0.0.0 Jetty Connector HTTPS
61616 0.0.0.0 ActiveMQ Message Broker Connector
Started Application Modules:
EAR: geronimo/daytrader-derby-jetty/1.0/car
EAR: geronimo/uddi-jetty/1.0/car
EAR: geronimo/webconsole-jetty/1.0/car
RAR: geronimo/activemq/1.0/car
RAR: geronimo/system-database/1.0/car
WAR: geronimo/jmxdebug-jetty/1.0/car
WAR: geronimo/jsp-examples-jetty/1.0/car
WAR: geronimo/ldap-demo-jetty/1.0/car
WAR: geronimo/remote-deploy-jetty/1.0/car
WAR: geronimo/servlets-examples-jetty/1.0/car
WAR: geronimo/welcome-jetty/1.0/car
Web Applications:
http://localhost:8080/
http://localhost:8080/console
http://localhost:8080/console-standard
http://localhost:8080/daytrader
http://localhost:8080/debug-tool
http://localhost:8080/jsp-examples
http://localhost:8080/juddi
http://localhost:8080/ldap-demo
http://localhost:8080/remote-deploy
http://localhost:8080/servlets-examples
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-pre)] 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.0-pre)] 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 repository/ directory and then a directory named jars/ under that, and copy the JDBC driver there (for example, for Oracle, create repository/oracle/jars/ and then copy the Oracle JDBC driver into there). For more information, see Section 6.1, “JDBC Drivers”. | |
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/derbyclient/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.
![]() | Warning |
|---|---|
Derby lets you create a database on the fly by manipulating the connection URL, but due to a bug in Geronimo 1.0, it's not possible to configure this from the management console when the Tomcat web container is used (however, it does work in Jetty). | |
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-pre)]). 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://cvs.apache.org/repository/geronimo/wars/geronimo-welcome-1.0-SNAPSHOT.war and http://cvs.apache.org/repository/geronimo/wars/geronimo-ldap-demo-1.0-SNAPSHOT.war.
First, you can try deploying the Welcome application with no additional Geronimo customization:
java -jar bin/deployer.jar deploy \
geronimo-welcome-1.0-SNAPSHOT.warTo make sure this is running, try connecting to http://localhost:8080/geronimo-welcome-1.0-SNAPSHOT/. This is a very small web app, 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.0)] 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.0"
configId="TestWebApplication">
<context-root>/test-web</context-root>
<context-priority-classloader>
true
</context-priority-classloader>
<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.0-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
There are three methods for installing Geronimo. The quick start approach is fast and easy, but does not give you the opportunity to customize the installation. The install package is a traditional wizard-style installer, and it gives you more customization options during the install, at the cost of a somewhat more involved process. Finally, the automated install can be used to repeat an identical installation on a different machine, with no interaction required. Any of these approaches will result in a working server, so it's mainly a matter of whether you find the default network ports to be suitable and whether the automated install would be beneficial.
![]() | Note |
|---|---|
This chapter assumes you have downloaded a milestone release of Geronimo. If not, please see Chapter 2, Acquiring Geronimo & Quick Start [DRAFT (1.0)]. | |
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, the CORBA features currently used by Geronimo require a Sun 1.4.x JVM. That means the best option for Geronimo is currently the Sun 1.4.2 JVM. Broader compatibility with other JVM vendors and versions is a goal for future releases.
As far as operating systems go, Geronimo has been successfully run on:
Windows 2000, XP, and 2003
Linux x86 (Debian, Red Hat, SuSE, Mandrake, and Gentoo)
Linux x86_64 (SuSE)
Mac OS X
Solaris 8
HP-UX 11.0
Geronimo requires a Java compiler in order to handle JSP compilation. That means that in most cases a full Java Development Kit is required, though in special circumstances (with pre-compiled JSPs, no JSPs at all, or a third-party compiler) it can be run on a Java Runtime Environment instead. The next milestone release should eliminate this requirement by switching to a bundled compiler.
![]() | 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 -Djava.awt.headless=true option. However, certain rare applications may require a working X-Windows environment to run (or at least a simulated environment such as can be provided by xvfb). | |
The most expedient way to install a milestone release of Geronimo is to download and unpack the .zip or .tar.gz file for that milestone. No additional steps are necessary, and you will get a default, working configuration out of the box. However, with this approach, you aren't able to change any of the default configuration parameters (such as network ports).
To run the custom installation procedure, you'll need to download the installer package, which is an executable JAR. To start the install, run a command like this (using Java 1.4 or higher):
java -jar geronimo-1.0-M4-installer.jar
You should see the first screen of the installer:
Clicking brings up the license screen:
To proceed, select the I accept radio button and click to bring up the install path screen:
Select a path (by typing one in the box or selecting an existing directory with the button) and click to proceed. If the selected directory doesn't exist, you'll get one prompt:
Whereas if the directory does exist, you'll get a different prompt:
Generally speaking, it's best not to install the M4 release of Geronimo over top of a previous release. It's best to uninstall any previous release if desired, then install Geronimo M4 into a new directory.
After the directory select, the feature selection screen comes up:
There's generally no reason not to select all the features, since they add little space on top of the basic installation and even when installed they won't run unless manually started. The JMX Debug Tool is particularly useful as it's a simple web application you can start and browse to make sure the web container is up and running on the expected port.
Once the feature selection is complete, click to continue to the main configuration screen:
The default values are shown in Figure 3.7, “Geronimo Installer: Main Configuration”. The available fields are:
The administrative login for the server. This is primarily used by the deploy tool when it connects to a running server to deploy, start, or stop applications (see Section 10.4, “The Deploy Tool”). In future milestones, this will also be the account used to log in to the web-based management console.
Several of the included services bind to a specific host name / IP when starting. The two most common values for this settings are localhost (meaning accept connections from the same machine only) and 0.0.0.0 (meaning bind to all available network interfaces). However, in a machine with multiple network interfaces, it's possible to specify a specific IP or hostname here to listen on that interface only.
The network port that the web container listens on. This needs to be used in any HTTP URLs that refer to web applications running in Geronimo. Note that on UNIX platforms, you must run Geronimo as root to bind to privileged ports (under 1024), which is not recommend. To bind to port 80 (the default HTTP port), it would be better to run Geronimo behind an Apache web server where Apache listens on port 80 and Geronimo can listen on a non-privileged port.
The secure network port that the web container listens on. This needs to be used in any HTTPS URLs that refer to web applications running in Geronimo. Note that on UNIX platforms, you must run Geronimo as root to bind to privileged ports (under 1024), which is not recommend. To bind to port 443 (the default HTTPS port), it would be better to run Geronimo behind an Apache web server where Apache listens on port 443 and Geronimo can listen on a non-privileged port.
The network port that the security system listens on. This is used for client authentication requests, and it must be configured in the client's JAAS configuration (see Chapter 14, Client Applications (Client JARs) [IN PROGRESS]).
Once the basic options are finished, click to proceed to the EJB/IIOP configuration screen:
The default values are shown in Figure 3.8, “Geronimo Installer: EJB/IIOP Configuration”. The available fields are:
The network port that the JNDI server listens on. Remote clients use this to connect to the server's JNDI tree. You'll need to customize your connection settings every time you run the deploy tool if you change this, so it's best to keep the default value of 1099.
The network port that the EJB container listens on. TODO: does this need to be configured in clients anywhere?
The IP addresses that the EJB server should accept connections from. TODO: is there a value for "any" and how do you specify a list or range?
The port used to connect to EJBs via RMI-over-IIOP (as opposed to the plain RMI port listed under EJB Port above).
The port that the CORBA ORB listens on
The port that the CORBA naming service listens on. Similar to JNDI and RMI, a CORBA client will typically connect to the naming service first, then look up a specific service that it connects to using the ORB port.
Once the EJB/IIOP options are finished, click to proceed to the service configuration screen:
The default values are shown in Figure 3.9, “Geronimo Installer: Service Configuration”. The available fields are:
The network port that the default ActiveMQ JMS server listens on. This will need to be configured for any custom connection factories that should connect to that JMS server (a default connection factory is provided).
Geronimo includes an embedded Derby database used by the server itself. It is also available for use by applications, so it is configured for remote access, and this is the network port it listens on.
Once the service configuration options are set, click to proceed to the installation screen:
This screen unpacks all the raw Geronimo installation files. It doesn't quite result in a working installation, so when it finishes, click to continue to the customization screen: