Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

9.The next step is packaging the application.From a command line window change the directory to <app_home> and run the following command to package the HelloWorld application into a single .war file.

No Format
bgColor#000000
borderStylesolid

jar -cvf HelloWorld.war *

This will create a HelloWorld.war file in the <app_home> directory. The next step is to deploy this application.

...

11.Change directory to <geronimo_home>/bin and run the following command:

No Format
bgColor#000000
borderStylesolid

java -jar deployer.jar --user system --password manager deploy <app_home>/HelloWorld.war

12.For further instructions about deployment process please refer the Quick Start or Sample (Applications) working.The sample application code can be downloaded here.
HelloWorld web Sample

...

Code Block
java
java
HelloWorld
   |_ejbModule
   |          |_org.geronimo.ejbsample
   |          |                 |_HelloBean
   |          |                 |_HelloHome
   |          |                 |_HelloObject
   |          |
   |          |_org.geronimo.ejbsample.client
   |                                    |_HelloWorld
   |_META-INF
   |      |_ejb-jar.xml
   |      |_openejb-jar.xml
   |
   |_dist
   |_build
   |_build.xml
   

Here is the ejb-jar.xml for the above sample

...

org.geronimo.ejbsample.client.HelloWorld.java is the client code for the above application.Set the necessary class path to run client in your environment.

No Format
bgColor#000000
borderStylesolid

< <app-home>/org/geronimo/ejbsampleclient> >java HelloWorld

You will see the "Hello world" print on your command line

No Format
bgColor#000000
borderStylesolid

...

HelloWorld/org/geronimo/ejbsampleclient>
  Hello World!

*Image needed to be upload.

...

This sample application gives you an overview of basic steps to deploy an EAR application in Geronimo v1.1.
Though this is a simple application it helps new users to understand the basics of Geronimo v1.1 specific deployment plan for an EAR and move on to work with complex applications. In this sample ,Servelts are used in the back end while JSP is used in the front end.
The following diagram depicts the folder structure

Code Block
java
java
     HelloWorldEar
                |_src
                |    |_HelloWorld.java
                |_web
                |    |_index.jsp
                |_build
                |       |_src
                |      |    |_HelloWorld.class
                |      |_ear
                |      |  |_META_INF
                |      |  |     |_application.xml
                |      |  |     |_geronimo-application.xml
                |      |  |_helloworld.war
                |      |
                |      |_war
                |      |     |_WEB-INF
                |      |     |      |_classes
                |      |     |      |_web.xml
                |      |     |      |_geronimo-web.xml
                |      |     |_index.jsp
                |      |          
                |      |_deplomentdescriptors
                |                     |_application.xml
                |                     |_geronimo-application.xml
                |                     |_web.xml
                |                     |_geronimo-web.xml
                |_build.xml
                |_helloworld.ear

The HelloWorldEar application's content can be described as follows:-

...

Direct deployment can be done using the Geronimo v1.1 Web console or else application can be deployed using the following command.

No Format
bgColor#000000
borderStylesolid

java -jar <geronimo-home>/bin/deployer.jar deploy <app-home>helloworld.ear

...


Deploying a J2EE Connector resources archive (RAR) with Geronimo v1.1

...

Code Block
jca
   |_src
   |_meta   
   |   |_geronimo
   |           |_geronimo-ra.xml
   |           |_ra.xml
   |           |_jca-plan.xml
   |_web
   |  |_WEB_INF
   |        |_geronimo-web.xml
   |        |_web.xml
   |_jca.rar
   |_jca.war

J2EE RAR Deployment Plan

No Format
borderStylesolid
titlera.xml
<connector xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee                             http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd" version="1.5" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <display-name>FileRetriever</display-name>
  <vendor-name>IBM</vendor-name>
  <eis-type>File system</eis-type>
  <resourceadapter-version>1.0</resourceadapter-version>
  <resourceadapter>
    <outbound-resourceadapter>
      <connection-definition>
        <managedconnectionfactory-class>com.ibm.j2g.jca.connector.impl.FileRetrieverManagedConnectionFactory</managedconnectionfactory-class>
        <config-property>
          <description>Path to the directory being the file repository</description>
          <config-property-name>RepositoryPath</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
        </config-property>
        <connectionfactory-interface>com.ibm.j2g.jca.connector.FileRetrieverConnectionFactory</connectionfactory-interface>
        <connectionfactory-impl-class>com.ibm.j2g.jca.connector.impl.FileRetrieverConnectionFactoryImpl</connectionfactory-impl-class>
        <connection-interface>com.ibm.j2g.jca.connector.FileRetrieverConnection</connection-interface>
        <connection-impl-class>com.ibm.j2g.jca.connector.impl.FileRetrieverConnectionImpl</connection-impl-class>
      </connection-definition>
      <transaction-support>NoTransaction</transaction-support>
      <reauthentication-support>false</reauthentication-support>
    </outbound-resourceadapter>
  </resourceadapter>
</connector>

...

Next step is the deploying the RAR application with Geronimo.
As stated in the previous examples user will have two choices of deploying an application with Geronimo either Geronimo web console or command line.Here the command line option is described following.
From a command line, change directory to <jca_home> and type the following commands:
Deploying jca-plan.xml and RAR

No Format
bgColor#000000
borderStylesolid

java -jar <geronimo_home>/bin/deployer.jar --user system --password manager deploy meta/geronimo/jca-plan.xml jca.rar
No Format
bgColor#000000
borderStylesolid

java -jar <geronimo_home>/bin/deployer.jar --user system --password manager deploy jca.war
No Format
bgColor#000000
borderStylesolid

Insert the out put

Once the JCA application is deployed, open a Web browser and access the following URL:
http://localhost:8080/jca

...