Table of Contents
Each enterprise application is made up of a number of other J2EE modules (commonly packaged ionto an EAR file). When grouped together into one application, modules can:
share common class loaders
streamline deployment with simpler references to components in other modules
share common security role definitions
override or replace standard deployment descriptors with newer versions stored outside the modules themselves
in the case of web modules, map conveniently to context roots in the web server
Geronimo supports J2EE 1.4 applications, with backward compatibility to previous spec revisions. In addition to the common application features, a Geronimo application can:
add common libraries to the application class path
define new Geronimo services (which would be started and stopped with the application itself)
be arranged in a hierarchy, so classes in the current application would have direct access to classes in another (parent) application
override or replace standard Geronimo deployment plans for the included modules with newer versions stored outside the modules themselves
Deploying Enterprise Applications to Geronimo typically involves several steps:
Prepare the Web application WARs, EJB JARs, J2EE Connector RARs, application client JARs, and any third party JARs that will go into the enterprise application.
Create the standard application.xml deployment descriptor
Create a Geronimo-specific geronimo-application.xml deployment plan
Package the enterprise application and deployment descriptors into an EAR file, or a directory tree laid out like an EAR
Use the deployment tool described in Section 10.4, “The Deploy Tool” to deploy the EAR into the server
The process of developing enterprise applications and the standard application.xml deployment descriptor should be familiar already. After a brief review of what Geronimo expects from an EAR, this chapter focuses mainly on the contents of the Geronimo geronimo-application.xml deployment plan. This plan may be packaged within the application EAR, or provided as a separate file to the deployment tool.
Geronimo doesn't have any special requirements on EAR files -- any EAR produced according to the standard J2EE process should work in Geronimo. However, there are a couple points to note:
Geronimo requires that every EAR file has a standard META-INF/application.xml deployment descriptor. This may be configured for J2EE 1.2, J2EE 1.3, or J2EE 1.4, and should follow the appropriate XML format (see below).
Any external libraries can be placed in the Geronimo server repository and referenced with dependency elements in the Geronimo deployment plan (see Section 15.3.1, “Customizing the Application Class Path”). Any changes to the EAR class path will be visible to web applications, EJBs, and J2EE Connectors within the EAR.
Geronimo expects the META-INF/application.xml file to obey one of the following standard formats:
Defined by the DTD at http://java.sun.com/j2ee/dtds/application_1_2.dtd, a J2EE 1.2 application deployment descriptor looks like this:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN" "http://java.sun.com/j2ee/dtds/application_1_2.dtd"> <application> ... </application>
Defined by the DTD at http://java.sun.com/dtd/application_1_3.dtd, a J2EE 1.3 application deployment descriptor looks like this:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd"> <application> ... </application>
Defined by the XML schema at http://java.sun.com/xml/ns/j2ee/application_1_4.xsd, a J2EE 1.4 application deployment descriptor looks like this:
<?xml version="1.0" encoding="UTF-8"?> <application 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/application_1_4.xsd" version="1.4"> ... </application>