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:
- Container-managed entity EJB
- 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.
- Specify the connector module in the application deployment descriptor.
- Specify the connector deployment plan in the Geronimo-specfic application deployment descriptor.
- Package the application EAR.
- 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.