{scrollbar}

Overview

INLINE

The Geronimo deployment plan for an enterprise application, which is usually packaged as a EAR file, is called "geronimo-application.xml".

The geronimo-application.xml deployment plan is used in conjunction with the application.xml JAVA EE deployment plan to deploy enterprise applications consisting of Web Application WAR(s), EJB JAR(s), client application JAR(s), JCA connector JAR(s), and resource adapter module RAR(s) to the Geronimo application server. The geronimo-application.xml deployment plan is an optional file, but is typically used when deploying an EAR file. It is used to specify a moduleId for the deployed module, any third party dependencies, security options, and services.

Packaging

The geronimo-application.xml deployment plan can be packaged as follows:

  1. Embedded in an EAR file. In this case, a geronimo-application.xml file must be placed in the /META-INF directory of the EAR, which is the same place where the application.xml file must be located.

  2. Maintained separately from the EAR file. In this case, the path to the file must be provided to the appropriate Geronimo deployer (e.g., command-line or console). Note that in this case, the filename can be named something other than geronimo-application.xml but must adhere to the same schema.

Schema

The geronimo-application.xml deployment plan is defined by the geronimo-application-2.0.xsd schema located in the <geronimo_home>/schema/ subdirectory of the main Geronimo installation directory. The geronimo-application-2.0.xsd schema is briefly described here:

http://geronimo.apache.org/schemas-2.1/docs/geronimo-application-2.0.xsd.html

Schema top-level elements

The root XML element in the geronimo-application-2.0.xsd schema is the <application> element. The top-level XML elements of the <application> root element are described in the sections below. The deployment plan should always use the Web application namespace, and it typically requires elements from Geronimo System and Geronimo Security namespaces. Additionally, it has an attribute to identify its name. A typical deployment for geronimo-application.xml can be presented as follows:

xmlgeronimo-application.xml Examplesolid <app:application xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0" application-name="SampleApplicationName"> ... </app:application>

<sys:environment>

The <sys:environment> XML element uses the Geronimo System namespace, which is used to specify the common elements for common libraries and module-scoped services, and is described here:

The <sys:environment> element contains the following elements:

An example geronimo-application.xml file is shown below using the <sys:environment> elements:

xmlsolid<sys:environment> example <app:application xmlns:conn="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0" application-name="SampleEAR"> <dep:environment> <dep:moduleId> <dep:groupId>sampleear</dep:groupId> <dep:artifactId>sample-ear</dep:artifactId> <dep:version>1.0</dep:version> <dep:type>ear</dep:type> </dep:moduleId> <dep:dependencies> <dep:dependency> <dep:groupId>org.apache.geronimo.configs</dep:groupId> <dep:artifactId>tomcat6</dep:artifactId> <dep:version>2.2-SNAPSHOT</dep:version> <dep:type>car</dep:type> </dep:dependency> <dep:dependency> <dep:groupId>default</dep:groupId> <dep:artifactId>geronim-web-4</dep:artifactId> <dep:version>1.0</dep:version> <dep:type>car</dep:type> </dep:dependency> </dep:dependencies> </dep:environment> </app:application>

<module>

The <module> uses the Geronimo default namespace for a geronimo-application.xml file that is described here:

This element is used to define a single Java EE module and contains one of the following elements to identify the module:

The <module> element also contains an optional <alt-dd> element that specifies an optional URI to the post-assembly version of the deployment descriptor file for a particular Java EE module. If <alt-dd> is not specified, the deployer must read the deployment descriptor from the default location and file name required by the respective component specification.

xmlsolid<module> example <application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2" application-name="MDBSampleEAR"> <module> <ejb>example-ejb.jar</ejb> <alt-dd>dds/my-ejb-geronimo-plan.xml</alt-dd> </module> <module> <web> <web-uri>example-web.war</web-uri> <context-root>example</context-root> </web> </module> </application>

Then the Geronimo deployment plan could include separate deployment plans for both modules like this:

xmlsolid<module> example <application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2" application-name="MDBSampleEAR"> <module> <ejb>example-ejb.jar</ejb> <alt-dd>dds/my-ejb-jar.xml</alt-dd> </module> <module> <web> <web-uri>example-web.war</web-uri> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.0"> <naming:resource-ref> <naming:ref-name>jms/AConnectionFactory</naming:ref-name> <naming:resource-link>MyConnectionFactory</naming:resource-link> </naming:resource-ref> </web-app> </web> </module> </application>

In this case, the EJB deployment plan is stored inside the EAR (in a directory called dds/ that also holds a replacement for ejb-jar.xml for that module). The Web application deployment plan is right there inside the EAR deployment plan, in its entirety.

<ext-module>

The <ext-module> uses the Geronimo default namespace for a geronimo-application.xml file that is described here:

This element can be used to define a single external Jave EE module that is being deployed or redeployed and contains one of the following elements to identify the module:

The <ext-module> element also contains either an <internal-path> or an <external-path>. <internal-path> indicates that the module is packaged in the EAR and the path specified is relative to the enterprise application package main directory. <external-path> indicates that the module is not part of the enterprise application and must be located by matching the supplied pattern in a Geronimo repository.

xmlsolid<ext-module> example <application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2" application-name="MDBSampleEAR"> <sys:environment> <sys:moduleId> <sys:groupId>default</sys:groupId> <sys:artifactId>MDBSampleEAR</sys:artifactId> <sys:version>1.0</sys:version> <sys:type>car</sys:type> </sys:moduleId> </sys:environment> <ext-module> <connector>TopicJMSSample</connector> <external-path> <sys:groupId>org.apache.geronimo.modules</sys:groupId> <sys:artifactId>geronimo-activemq-ra</sys:artifactId> <sys:version>2.1</sys:version> </external-path> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"> <resourceadapter> <!--how to connect to the JMS Server--> <resourceadapter-instance> <resourceadapter-name>TradeJMSResources</resourceadapter-name> <config-property-setting name="ServerUrl">tcp://localhost:61616</config-property-setting> <config-property-setting name="UserName">not needed</config-property-setting> <config-property-setting name="Password">not needed</config-property-setting> <workmanager> <gbean-link>DefaultWorkManager</gbean-link> </workmanager> </resourceadapter-instance> <!--defines a ConnectionFactory--> <outbound-resourceadapter> <connection-definition> <connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface> <connectiondefinition-instance> <name>jms/TopicConnectionFactory</name> <implemented-interface>javax.jms.TopicConnectionFactory</implemented-interface> <connectionmanager> <xa-transaction> <transaction-caching/> </xa-transaction> <single-pool> <max-size>10</max-size> <min-size>0</min-size> <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds> <idle-timeout-minutes>0</idle-timeout-minutes> <match-one/> </single-pool> </connectionmanager> </connectiondefinition-instance> </connection-definition> </outbound-resourceadapter> </resourceadapter> <adminobject> <adminobject-interface>javax.jms.Topic</adminobject-interface> <adminobject-class>org.activemq.message.ActiveMQTopic</adminobject-class> <adminobject-instance> <message-destination-name>TextMessageTopic</message-destination-name> <config-property-setting name="PhysicalName">TextMessageTopic</config-property-setting> </adminobject-instance> </adminobject> </connector> </ext-module> </application>

<sec:security>

The <sec:security> uses the Geronimo applicaiton namespace described here:

It is used to map roles specified in the EAR file to roles or principals in the security realm that will be used when deploying the module. If this optional element is present, all web and EJB modules must make the appropriate access checks as outlined in the JACC spec. This element groups the security role mapping settings for the application. <app:security> contains the following elements:

xmlsolid<sec:security> example <application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0" application-name="SampleSecurityEAR"> <dep:environment> <dep:moduleId> <dep:groupId>sampleear</dep:groupId> <dep:artifactId>sample-ear</dep:artifactId> <dep:version>1.0</dep:version> <dep:type>ear</dep:type> </dep:moduleId> <dep:dependencies> <dep:dependency> <dep:groupId>org.apache.geronimo.configs</dep:groupId> <dep:artifactId>tomcat6</dep:artifactId> <dep:version>2.2-SNAPSHOT</dep:version> <dep:type>car</dep:type> </dep:dependency> <dep:dependency> <dep:groupId>default</dep:groupId> <dep:artifactId>geronim-web-4</dep:artifactId> <dep:version>1.0</dep:version> <dep:type>car</dep:type> </dep:dependency> </dep:dependencies> </dep:environment> <sec:security use-context-handler="false" doas-current-caller="true" default-role="admin1"> <sec:role-mappings> <sec:role role-name="admin-role"> <sec:description>ability to do everything</sec:description> </sec:role> <sec:role role-name="user-role"> <sec:description>limited access</sec:description> </sec:role> </sec:role-mappings> </sec:security> </application>

<sys:service>

The <sys:service> element uses the Geronimo deployment namespace described here:

It is used to define GBean(s) that are configured and deployed with the application. These additional Geronimo services will be deployed when the application is deployed (and stopped when the application is stopped). Normally, the implementation classes for these services are included at the server level and referenced using a dependency element.