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 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 etc..This is the first step in Geronimo v1.2 deployment plans which with cover a simple sample.
The next step of deployment plan will be ready for users soon, which will provide you with complex and advance samples.This first step will help beginners of Apache Geronimo v1.2 get an insight.

Apache Geronimo v1.2 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

Work Out Deployment Plans with Samples

Assumptions

It is assumed that you have installed the either Tomcat or the Jetty version of Geronimo v1.2 successfully and it is working. Please find the further details to get the software and install it.(need to direct the link to Installation Guide and the User Guide)

Deployment plan for WAR Module

Deploying and Undeploying Helloworld sample.

This section will cover understanding how the deployment plan works for different application modules.
First let's have look at the simple "HelloWorld"example which creates a Web Application Archive (WAR) under the WEB-INF directory and has a geronimo-web.xml as the Apache Geronimo specific deployment Plan.

Here are the steps to understand the deployment plan for the "HelloWorld" Example
1.Create a folder in called <app_home> in your working directory
2.Open a new text file and save it as "HelloWorld.jsp" in side the app_home directory
3.Copy and paste the following code with the "HelloWorld.jsp" in it.

5.Open a new text file and save it as "geronimo-web.xml" and this is the Apache Geronimo v1.2 deployment plan for this sample module.
6.Copy and paste the following xml code in that file and save it inside the <app_home\WEB-INF> directory.

Deploying JAR containing Simple EJB application

This section will cover Geronimo v1.1 deployment plan for the simple helloworld ejb.
Here is the folder structure for the above simple application.Sample Application is available to download hereHelloWorld ejb Sample

Steps to deploying the sample

There are two ways in which the sample can be deployed :-

1. The sample can be built from scratch using the build.xml and editing the geronimo_home as your directory. Obtain the helloworld-ejbs.jar from the dist directory and use the Geronimo web console. Browse for the helloworld-ejbs.jar file and click on the Install button.

2.Use the following command line code to deploy the application.

Running the Client to test the HelloWorld EJB service

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.

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

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

HelloWorld/org/geronimo/ejbsampleclient>
Hello World!

*Image needed to be upload.

Deploying the EAR Application On Geronimo v1.2

This sample application gives you an overview of basic steps to deploy an EAR application in Geronimo v1.2.
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

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

src-HelloWorld servlet

web-JSP

build -where all the build outputs go and it contains sub folders such as; src ,war,ear,deploymentdescriptors.

build.xml-The build file is also attached in the source bundle. In order to run this build file,change the class paths and <geronimo_home> as relevant to your environment.

helloworld.ear - This is the final distribution of the application and it will be created at the root folder as shown.
Source code can be downloaded from here

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

This section will describe the deployment plan for RAR application with Geronimo v1.2.The base of this sample has been borrowed and modified from User Guide.(Migration to Apache Geronimo-JBoss to Geronimo JCA migration.html)This sample contains a File Retriever JCA sample application it consists of two modules that, (for the purpose of this sample)for this sample purposes, are deployed separately and not as a single EAR archive.
The first module is a simple file system resource adapter that conforms to the JCA architecture without any server-specific extensions. The adapter provides two functions:

Lists names of files and directories located in a specific repository being a directory in the underlying file system.

Retrieves the content of one of the files.

The second module is a Web application that uses the adapter and provides online access to the files.

The user views a list of directories and files located in the repository and clicks a file to download it from the server. By default the resource adapter is configured so that the root directory of an application server is used as the repository.

To deploy the adapter on Geronimo you also need a deployment plan specific to this server. Such a plan can be either named geronimo-ra.xml and be placed into the META-INF folder of the corresponding RAR archive, or can have any name and stay outside the archive. In the latter case, the path to the plan should be specified during the deployment of the resource adapter.
The deployment plan used by the sample application contains the repository path configuration parameter that may be updated before the deployment. Because of this, the jca-plan.xml file is not included in the RAR archive but it is placed into the <jca_home>/meta/geronimo directory instead. The content of this file is listed in the following example.

In this deployment plan the attribute <dep:moduleId> </dep:moduleId>segment specifies the unique name com/ibm/j2g/jca.rar used to identify the RAR module in Geronimo and that this module is deployed on the server as a separate component.
The descriptor also:

Defines the FileRetriever name which looks up the resource adapter factory.

Building the sample Application.

In order to build the modules of the File Retriever JCA application you need to update the build.properties file and property such as <geronimo_home> matches your environment.

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