You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 47 Next »

This is template for the main Deployment plan

Introduction

Every service, application or resource in Geronimo is configured with an xml deployment plan. Deployment plans are the Geronimo version of the J2EE deployment descriptors. They are still XML files based on XML schemas 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 Create new database pools and LDAP Realm sections as some examples.

Apache Geronimo v1.1 deployment plans

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

geronimo_web.xml

This is the end of the main page of the deployment plan

This section has to be moved in to seperate page

Deployment plan for geronimo-application.xml and openejb-jar.xml

The following sample is an Email address book which covers how to deploy the J2EE Applications on computer running Apache Geronimo V1.1.AddressBook samples has used JSP,Struts EJB and mysql as the data base.Here It's assumed that you have the basic knowledge and experience of playing with EBJ a,JSP and servlets with other application servers.
AddresBook samples use JSP primarily for presentation logic and the HTML code.Servlets form the controller layer of a typical Model-View-Controller(MVC)architecture serve as an interface between the presentation and the model layers.
The three tire architecture and layers are shown in the picture.

Following diagram shows how the code is organized in the application

AddressBook
       |_org.apache.geronimo.sample.addressbook.ejb
       |                                           |_AddressBookEntryBean.java
       |                                           |_AddressBookSessionBean.java
       |_org.apache.geronimo.sample.addressbook.struts
       |                                           |_AddressBookEntryForm.java
       |                                           |_CreateEntry.java
       |                                           |_EditEntry.java
       |                                           |_ListAddress.java
       |                                           |_SaveEntry.java
       |_org.apache.geronimo.sample.addressbook.pages
       |                                           |_EditAddressBook.jsp
       |                                           |_footer.jsp
       |                                           |_ListAddressBookPage.jsp
       |                                           |_navigation.jsp
       |                                           |_site-template.jsp
       |
       |_resource
          |_ear
          |   |_META_INF
          |   |   |_application.xml
          |   |   |_geronimo-application.xml
          |   |_mysql-plan.xml
          |   |_tranql-connector-1.0-SNAPSHOT.rar
          |
          |_ejb
          |  |_META_INF
          |      |_openejb-jar.xml
          |_merge
          |   |_README.txt
          |   |_servlets.xml
          |   |_servlets-mappings.xml
          |   |_struts-controller.xml
          |   |_strust-data-sources.xml
          |   |_struts-forms.xml
          |   |_struts-plugins.xml
          |   |_taglibs.xml
          |
          |_webapp
             |_images
             |_pages
             |_style
             |
             |_WEB_INF
             |  |_classes
             |   |      |_resources
             |   |          |_application.properties
             |   |_conf
             |   |    |_struts-config.xml
             |   |    |_validation.xml
             |   |
             |   |_tld
             |       |_geronimo-jetty.xml
             |       |_tiles-defs.xml
             |       |_validator-rules.xml
             |_index.jsp


JSP and Struts
The Struts action classes are in the AddressBook/src/org/apache/geronimo/sample/addressbook/struts directory. The JSPs are in the AddressBook/src/webapp/pages directory.

EJB
Apache Geronimo uses OpenEJB as the EJB container system. The example contains two EJBs:

  1. Container-managed entity EJB
  2. Stateless session EJB

Deploying an Application-Scoped Connection Pool

An Application scoped connection pool is visible only to the application that deployed it.To deploy an application-scoped connection pool,you need to follow these steps.

  1. Specify the connector module in the application deployment descriptor.
  2. Specify the connector deployment plan in the Geronimo-specfic application deployment descriptor.
  3. Package the application EAR.
  4. Specify the the Connector Module in the Application Deployment Descriptor

The Application deployment descriptor(AddressBook/resources/ear/META-INF/application.xml)should define the TranQL connector module,as shown here.

<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">
    <module>
        <ejb>addressbook-ejb.jar</ejb>
    </module>
    <module>
        <web>
            <web-uri>addressbook.war</web-uri>
            <context-root>/addressbook</context-root>
        </web>
    </module>
    <module>
	    <connector>tranql-connector-1.1.rar</connector>
    </module>
</application>

It's a must to package the connector RAR file along with the application EAR file.

Specify the Connector Deployment Plan in the Geronimo Application Deployment Descriptor

Specify the connector deployment plan file in the Geronimo application deployment Descriptor(AddressBook/resources/ear/ear/META-INF/geronimo-application.xml)as shown here.

Deployment plan for RAR Module

Deployment plan for JAR containing EJB Module

Deploying and Undeploying the AddressBook sample

Conclusion

  • No labels