Versions Compared

Key

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

...

No Format
borderStylesolid
titleHelloWorld.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>HelloWorld!</title>
</head>
<body bgcolor="#707DB8">
     <h1>
        <font face="courier" color="white">
                 Hello world from GERONIMO V1.1!
         </font>
       </h1>
          <font face="courier" color="white"> ${datetime}</font>
</html>
{code}

4.Create

...

a

...

new

...

folder

...

called"WEB-INF"

...

inside

...

the

...

app-home.

...

5.Open

...

up

...

new

...

text

...

file

...

and

...

save

...

it

...

as

...

"geronimo-web.xml"(use

...

simple

...

letters)and

...

this

...

is

...

the

...

apache

...

geronimo1.1deployment

...

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>

...

directcory.

{noformat:borderStyle=solid| title=
No Format
borderStylesolid
title
geronimo-web.xml
}
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
    <dep:moduleId>
      <dep:groupId>geronimo</dep:groupId>
      <dep:artifactId>HelloWorld</dep:artifactId>
      <dep:version>1.1</dep:version>
      <dep:type>war</dep:type>
    </dep:moduleId>
  </dep:environment>

  <context-root>/hello</context-root>

</web-app>

...

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.

...

10.User

...

can

...

use

...

the

...

preferable

...

deployment

...

approach

...

either

...

command

...

line

...

or

...

the

...

Geronimo

...

Web

...

Console.Here

...

it

...

describes

...

how

...

to

...

use

...

the

...

command

...

line.

...

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 the further instructions about deployment process please refer the Quick Start or Sample working.The sample application code can be downloaded here.
HelloWorld web 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.

...

Here is the application.xml for the above application

No Format
borderStylesolid
titleapplication.xml
Code Block
<?xml version="1.0" encoding="ISO-8859-1"?>

<application>
<display-name>HelloWorldEar</display-name>
<module>
<web>
<web-uri>helloworld.war</web-uri>
<context-root>/hello</context-root>
</web>
</module>
</application>

Here is the Geronimo specific deployment plan geronimo-application.xml

No Format
borderStylesolid
titlegeronimo-application.xml

...

code
<application application-name="HelloWorldEar" xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.1" xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1">
  <sys:environment>
    <sys:moduleId>
      <sys:groupId>default</sys:groupId>
      <sys:artifactId>HelloWorldEar_HelloWorldEar</sys:artifactId>
      <sys:version>1-default</sys:version>
      <sys:type>car</sys:type>
    </sys:moduleId>
    <sys:dependencies/>
    <sys:hidden-classes/>
    <sys:non-overridable-classes/>
  </sys:environment>
</application>

Here is the web.xml

code
No Format
borderStylesolid
titleweb.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
    <dep:moduleId>
      <dep:groupId>geronimo</dep:groupId>groupId>code
      <dep:artifactId>HelloWorldEar</dep:artifactId>
      <dep:version>1.1</dep:version>
      <dep:type>war</dep:type>
    </dep:moduleId>
  </dep:environment>

  <context-root>/hello</context-root>

</web-app>
{code}

Here is the geronimo-web.xml for the above war module.

...

Code Block

{noformat:borderStyle=solid}
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
    <dep:moduleId>
      <dep:groupId>geronimo</dep:groupId>
      <dep:artifactId>HelloWorldEar</dep:artifactId>
      <dep:version>1.1</dep:version>
      <dep:type>war</dep:type>
    </dep:moduleId>
  </dep:environment>

  <context-root>/hello</context-root>

</web-app>

The direct deployment can be done using the GeronimoV1.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 GeronimoV1.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

...

code
<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>

J2EE RAR GeronimoV1.1 deployment plan

No Format
borderStylesolid
titlegeronimo-ra.xml
Code Block

<connector version="1.5" xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
    <dep:moduleId>
      <dep:groupId>com</dep:groupId>
      <dep:artifactId>ibm</dep:artifactId>
      <dep:version>j2g</dep:version>
      <dep:type>jca.rar</dep:type>
    </dep:moduleId>
    <dep:dependencies/>
    <dep:hidden-classes/>
    <dep:non-overridable-classes/>
  </dep:environment>
  <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>

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.

code
No Format
borderStylesolid
<!--This is Geronimo-specific descriptor-->
<connector version="1.5" xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
    <dep:moduleId>
      <dep:groupId>com</dep:groupId>
      <dep:artifactId>ibm</dep:artifactId>
      <dep:version>j2g</dep:version>
      <dep:type>jca.rar</dep:type>
    </dep:moduleId>
    <dep:dependencies>
      <dep:dependency>
        <dep:groupId>geronimo</dep:groupId>
        <dep:artifactId>geronimo-connector</dep:artifactId>
       <!-- <dep:type>car</dep:type>-->
      </dep:dependency>
    </dep:dependencies>
    <dep:hidden-classes/>
    <dep:non-overridable-classes/>
  </dep:environment>
  <resourceadapter>
    <outbound-resourceadapter>
      <connection-definition>
        <connectionfactory-interface>com.ibm.j2g.jca.connector.FileRetrieverConnectionFactory</connectionfactory-interface>
        <connectiondefinition-instance>
          <name>FileRetriever</name>
          <config-property-setting name="RepositoryPath">..</config-property-setting>
          <connectionmanager>
            <no-transaction/>
            <no-pool/>
          </connectionmanager>
        </connectiondefinition-instance>
      </connection-definition>
    </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

...