Deployment plans are the Geronimo version of the J2EE deployment descriptors. They are still XML files based on XML schemas and containing the configuration details for a specific application module. Via the deployment plans you can not only deploy application modules but also other configurations such as a security realm, see the Deploying secure applications and Deploy the LDAP realm sections for further details and examples.

The following table illustrates the deployment descriptors name and file location for both standard J2EE and Apache Geronimo specific.

File

Standard Deployment Descriptors in the J2EE specification

Apache Geronimo specific Deployment plan

Web Application Archive (WAR)

web.xml under the WEB-INF directory

geronimo-web.xml

Enterprise Web application archive (EAR)

application.xml

geronimo-application.xml

J2EE Connector resources archive (RAR)

ra.xml

geronimo-ra.xml

J2EE client application archive (JAR)

client.xml

geronimo-application-client.xml

JAR containing EJBs

ejb-jar.xml under the META-INF directory

openejb-jar.xml

Here are some Geronimo specific deployment plan examples:

geronimo-web.xml

<web-app xmlns="http://geronimo.apache.org/xml/ns/web"
         xmlns:naming="http://geronimo.apache.org/xml/ns/naming"
         configId="MDBDemoWebApp">
         
     <context-root>messaging-ejb</context-root>    
     
    <ejb-ref>
        <ref-name>ejb/CustomerHome</ref-name>
        <target-name>geronimo.server:EJBModule=MDBDemo,J2EEApplication=null,J2EEServer=geronimo,j2eeType=EntityBean,name=CustomerEJB</target-name>
    </ejb-ref>

	<resource-ref>
        <ref-name>jms/broker</ref-name>
        <resource-link>DefaultActiveMQConnectionFactory</resource-link>
    </resource-ref>
    
    <resource-env-ref>
        <ref-name>jms/queue/DefQueue</ref-name>
        <message-destination-link>SendReceiveQueue</message-destination-link>
    </resource-env-ref>
    
</web-app>

Back to Top

geronimo-application.xml

<application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application"
	configId="com/ibm/j2g/security">

    <security xmlns="http://geronimo.apache.org/xml/ns/security">
        <default-principal realm-name="j2g">
            <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="system"/>
        </default-principal>
        <role-mappings>
            <role role-name="authenticated">
                <realm realm-name="j2g">
                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="authenticated"/>
                </realm>
            </role>
            <role role-name="uploader">
                <realm realm-name="j2g">
                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="uploader"/>
               </realm>
            </role>
        </role-mappings>
    </security>

   	<gb:gbean name="j2g-realm" class="org.apache.geronimo.security.realm.GenericSecurityRealm"
   		xmlns:gb="http://geronimo.apache.org/xml/ns/deployment-1.0">
        <gb:reference name="ServerInfo">
        	<gb:application>*</gb:application>
        	<gb:module>org/apache/geronimo/System</gb:module>
        	<gb:name>ServerInfo</gb:name>
        </gb:reference>
        <gb:reference name="LoginService">
        	<gb:application>*</gb:application>
        	<gb:module>org/apache/geronimo/Security</gb:module>
        	<gb:name>JaasLoginService</gb:name>
        </gb:reference>
    	<gb:attribute name="realmName">j2g</gb:attribute>
    	<gb:xml-reference name="LoginModuleConfiguration">
    		<l:login-config xmlns:l="http://geronimo.apache.org/xml/ns/loginconfig">
    			<l:login-module control-flag="REQUIRED" server-side="true">
    				<l:login-domain-name>j2g</l:login-domain-name>
    				<l:login-module-class>
    					org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule
    				</l:login-module-class>
     				<l:option name="usersURI">
				    	var/security/j2g_users.properties
			        </l:option>
        			<l:option name="groupsURI">
          				var/security/j2g_groups.properties
        			</l:option>
    			</l:login-module>
    		</l:login-config>
    	</gb:xml-reference>
    </gb:gbean>
</application>

Back to Top

geronimo-ra.xml

<?xml version="1.0" encoding="UTF-8"?>
<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector" version="1.5"
        configId="com/ibm/j2g/jca.rar">

    <resourceadapter>
        <outbound-resourceadapter>
            <connection-definition>
                <connectionfactory-interface>com.ibm.j2g.jca.connector.FileRetrieverConnectionFactory</connectionfactory-interface>
                <connectiondefinition-instance>
                    <name>FileRetriever</name>
                    <!-- The following path refers to the Geronimo home directory -->
                    <config-property-setting name="RepositoryPath">..</config-property-setting>
                    <connectionmanager>
                        <no-transaction/>
                        <no-pool/>
                    </connectionmanager>
                </connectiondefinition-instance>
            </connection-definition>
        </outbound-resourceadapter>
    </resourceadapter>
</connector>

Back to Top

geronimo-application-client.xml

ANY DONATIONS WOULD BE APPRECIATED HERE

Back to Top

openejb-jar.xml

<openejb-jar
    xmlns="http://www.openejb.org/xml/ns/openejb-jar"
    xmlns:naming="http://geronimo.apache.org/xml/ns/naming"
    xmlns:security="http://geronimo.apache.org/xml/ns/security"
    xmlns:sys="http://geronimo.apache.org/xml/ns/deployment"
    configId="SessionBeanDemo" parentId="org/apache/geronimo/Server">
 <enterprise-beans>
 	
    <entity>
        <ejb-name>CustomerEJB</ejb-name>
        <jndi-name>CustomerHomeRemote</jndi-name>
        <local-jndi-name></local-jndi-name>
        <resource-ref>
            <ref-name>jdbc/ibm-demo</ref-name>
            <resource-link>SystemDatasource</resource-link>
        </resource-ref>
    </entity>
    
    <session>
        <ejb-name>LoanManagerEJB</ejb-name>
        <jndi-name>LoanManagerHomeRemote</jndi-name>
        <ejb-ref>
            <ref-name>ejb/CustomerHomeRemote</ref-name>
            <ejb-link>CustomerEJB</ejb-link>
        </ejb-ref>        
   </session>
 	
 	<session>
        <ejb-name>StatefulLoanManagerEJB</ejb-name>
        <jndi-name>StatefulLoanManagerHomeRemote</jndi-name>
        <ejb-ref>
            <ref-name>ejb/CustomerHomeRemote</ref-name>
            <ejb-link>CustomerEJB</ejb-link>
        </ejb-ref>        
   </session>
   
 </enterprise-beans>
    
</openejb-jar>

Back to Top