From scm-return-47038-apmail-geronimo-scm-archive=geronimo.apache.org@geronimo.apache.org Mon Aug 8 02:38:28 2011 Return-Path: X-Original-To: apmail-geronimo-scm-archive@www.apache.org Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A156C8ADE for ; Mon, 8 Aug 2011 02:38:28 +0000 (UTC) Received: (qmail 61032 invoked by uid 500); 8 Aug 2011 02:38:28 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 60899 invoked by uid 500); 8 Aug 2011 02:38:27 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 60892 invoked by uid 99); 8 Aug 2011 02:38:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Aug 2011 02:38:26 +0000 X-ASF-Spam-Status: No, hits=-1994.3 required=5.0 tests=ALL_TRUSTED,HTML_FONT_LOW_CONTRAST,HTML_MESSAGE,MIME_HTML_ONLY X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Aug 2011 02:38:22 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p782c0xt016374 for ; Mon, 8 Aug 2011 02:38:00 GMT Date: Sun, 7 Aug 2011 22:38:00 -0400 (EDT) From: confluence@apache.org To: scm@geronimo.apache.org Message-ID: <16506641.11809.1312771080197.JavaMail.confluence@thor> Subject: [CONF] Apache Geronimo v3.0 > Migrating from G 2.x to G 3.x MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Auto-Submitted: auto-generated X-Virus-Checked: Checked by ClamAV on apache.org

Migrating from G 2.x to G 3.x

Page edited by Runhua Chi


Changes (30)

=20 =20
=20 = =20
The following is a guide for= converting the deployment descriptors for an application built for Geronim= o 2.x to the appropriate descriptors for Geronimo 3.0. Other changes might= be required to either the deployment plans or the application itself depen= ding on the application.
CE 3.0 provides backward compatibility to Java EE 5 compliant applica= tions. If you have applications running on Geronimo 2.x successfully, you c= an easily port them to Geronimo 3.0. However, there are a few updates you n= eed to consider as followed.
{toc:maxlevel=3D1}

{toc:maxLevel=3D2}
h1. Classloading options in the deployment plan
* *hidden-classes= * The deployment codes in Geronimo 3.0 will covert hidden-classes configura= tion to import-package style. For exmaple, {{<hidden-classes>javax.fa= ces</hidden-classes>}} should be {{<import-package>!javax.faces= </import-package>}}.
* *non-overridable-classes* Geronimo 3.0 doe= s not support the element in the deployment plan.
* *private-classes* = Geronimo 3.0 does not support the element in the deployment plan.
* *in= verse-classloading* Geronimo 3.0 does not support the element in the deploy= ment plan.

h1. EAR Project Definition <= br>
h1. DB initialization at deployment time
To initialize a database= using deployment plan file, {{org.apache.geronimo.connector.DatabaseInitia= lizationGBean}} in 2.X should be changed to {{org.apache.geronimo.connector= .wrapper.DatabaseInitializationGBean}}.

h3. application.xml
h1. JavaMail session generation and resource lookup
There are fol= lowing changes regarding Java Mail configuration in Geronimo 3.0.
* To = generate JavaMaill sessions using deployment plan file, {{org.apache.geroni= mo.mail.MailGBean}} in 2.X should be changed to {{org.apache.geronimo.resou= rce.mail.MailGBean}}.
* To configure JavaMail SMTP transport protocal = using deployment plan file, {{org.apache.geronimo.mail.SMTPTransportGBean}}= in 2.X should be changed to {{org.apache.geronimo.resource.mail.SMTPTransp= ortGBean}}.
* JNDI names of mailGBean should start with {{ger:}}, {{jca= :}} or {{java:}} prefix. For example:
{code:xml}
<attribute n= ame=3D"jndiName">mail/PlantsByWebSphere</attribute> {code}
should be changed to
{code:xml}
<attribute name= =3D"jndiName">ger:mail/PlantsByWebSphere</attribute> {code}

No Changes Required
h1. Dependencies changes
The following table lists the changes of= some components name from Geronimo 2.x to 3.0.
|| groupId || In 2.X|| = In 3.0 ||
| org.apache.geronimo.configs | client-transaction | client-t= ransaction-1_6 |
| org.apache.geronimo.configs | connector-deployer | c= onnector-deployer-1_6 |

h3. geronimo-application.xml=
|| Attribute || Geronimo 1.1 || Geronimo 2.1/2.2 || Geronimo 3.0 || | xmlns | http://geronimo.apache.org/xml/ns/j2ee/application-1.1 | htt= p://geronimo.apache.org/xml/ns/j2ee/application-2.0 | http://geronimo.apac= he.org/xml/ns/j2ee/application-2.0 |
h1. Servlets expecting multipart request
In Servlet 3.0, an annot= ation @MultiPartConfig has been introduced to indicate that the servlet exp= ects request of type multipart. You need to enable the feature in your depl= oyment plan file as followed:
{code:title=3Dgeronimo-web.xml}
... <= br> <context allowCasualMultipartParsing=3D"true"></co= ntext>
...
{code}

h1. Changes regarding EJB component
In Geronimo 3.0, resources ar= e imported and exported using different elements in deployment plan.
h2= . For a standalone EJB module
If your EJB application is a standalone m= odule, you need to export its package in the deployment plan file under nam= e space of {{http://geronimo.apache.org/xml/ns/deployment-1.2}}. For examp= le:
{code:xml}
...
<dep:export-package>ejb.stateful<= ;/dep:export-package>
...
{code}
While for any modules which= call the deployed EJB, you need to import the EJB package in the deploymen= t plan using the same name space. For example:
{code:xml}
...
= <dep:import-package>ejb.stateful</dep:import-package>
...=
{code}

h1. EJB Project Definition <= br>
h2. For a web application referring EJB interfaces
If your web ap= plication refers to a standalone EJB module, you need to specify the artifa= ct id of the EJB module in the deployment plan file of you web application.= For example:
{code:xml}
...
<nam:ejb-ref>
= <nam:ref-name>ejb/CustomerHome</nam:ref-name>
<= ;nam:pattern>
<nam:groupId>wasce-samples</nam:g= roupId>
<!--specific 3.0.0.0 standalone ejb configura= tion: ejb jar file name-->
<nam:artifactId>mdb-ejb= -3.0.0.0.jar</nam:artifactId>
<nam:name>Custome= rEJB</nam:name>
</nam:pattern>
</nam:ejb= -ref>
{code}

h3. ejb-jar.xml
No Chang= es Required
h2. For an EJB module embedded in EAR
If an EAR application conta= ins an application client module, an EJB module and web application module.= If the application client refers to one of ejb interfaces using following = code:
{code:java}
h3. openejb-jar.xml
@EJB
|| Attribute || Geronimo 1.1= || Geronimo 2.1/2.2 || Geronimo 3.0 ||
| xmlns | http://openejb.org= /xml/ns/openejb-jar-2.1 | http://openejb.apache.org/xml/ns/openejb-jar-2.2= | http://openejb.apache.org/xml/ns/openejb-jar-2.2 |
| xmlns:nam = | http://geronimo.apache.org/xml/ns/naming-1.1 | http://geronimo.apache.o= rg/xml/ns/naming-1.2 | http://geronimo.apache.org/xml/ns/naming-1.2 | | xmlns:pkgen | http://www.openejb.org/xml/ns/pkgen-2.0 | http://opene= jb.apache.org/xml/ns/pkgen-2.1 | http://openejb.apache.org/xml/ns/pkgen-2.= 1 |
| xmlns:sec | http://geronimo.apache.org/xml/ns/security-1.1 |= http://geronimo.apache.org/xml/ns/security-2.0 | http://geronimo.apache.o= rg/xml/ns/security-2.0 |
| xmlns:sys | http://geronimo.apache.org/x= ml/ns/deployment-1.1 | http://geronimo.apache.org/xml/ns/deployment-1.2 = | http://geronimo.apache.org/xml/ns/deployment-1.2 |
private static TradeSLSBRemote tradeSLSBRemote;
{code}
h1. WebApp Project Definitio= n
Although the ejb.jar is defined in its class-path using {{manifest.mf= }} file, the EJB interface is not in its class path. You need to package t= he ejb module into the EAR using the following structure:
{noformat}
h3. web.xml
No Changes R= equired
my-ear-3.0.0.0/lib/ejbinterface.jar
h3. geronimo-web.xml
|| = Attribute || Geronimo 1.1 || Geronimo 2.1/2.2 || Geronimo 3.0 ||
| xml= ns | http://geronimo.apache.org/xml/ns/j2ee/web-1.1 | http://geronimo.a= pache.org/xml/ns/j2ee/web-2.0.1 | http://geronimo.apache.org/xml/ns/j2ee/w= eb-2.0.1 |
{noformat}

Full Content

CE 3.0 provides backward compatibility to Java EE 5 compliant ap= plications. If you have applications running on Geronimo 2.x successfully, = you can easily port them to Geronimo 3.0. However, there are a few updates = you need to consider as followed.

Classloading options in the deployment plan

    =09
  • hidden-classes The deployment codes in Geronimo 3.0 will cove= rt hidden-classes configuration to import-package style. For exmaple, &= lt;hidden-classes>javax.faces</hidden-classes> should be = <import-package>!javax.faces</import-package>.
  • =09
  • non-overridable-classes Geronimo 3.0 does not support the ele= ment in the deployment plan.
  • =09
  • private-classes Geronimo 3.0 does not support the element in= the deployment plan.
  • =09
  • inverse-classloading Geronimo 3.0 does not support the elemen= t in the deployment plan.

DB initialization at deployment time

To initialize a database using deployment plan file, org.apache.gero= nimo.connector.DatabaseInitializationGBean in 2.X should be changed to= org.apache.geronimo.connector.wrapper.DatabaseInitializationGBean= .

JavaMail session generation and resource lookup

There are following changes regarding Java Mail configuration in Geronim= o 3.0.

    =09
  • To generate JavaMaill sessions using deployment plan file, org.a= pache.geronimo.mail.MailGBean in 2.X should be changed to org.apac= he.geronimo.resource.mail.MailGBean.
  • =09
  • To configure JavaMail SMTP transport protocal using deployment plan = file, org.apache.geronimo.mail.SMTPTransportGBean in 2.X should be= changed to org.apache.geronimo.resource.mail.SMTPTransportGBean.<= /li> =09
  • JNDI names of mailGBean should start with ger:, jca: or java: prefix. For example:
       <attribute name=3D"jndiName">mail/PlantsByWebSphere</attribute>=20
    

    should be changed to

       <attribute name=3D"jndiName">ger:mail/PlantsByWebSphere</attribute>
    

Dependencie= s changes

The following table lists the changes of some components name from Geron= imo 2.x to 3.0.

groupId In 2.X In 3.0
org.apache.geronimo.configs client-transaction client-transaction-1_6
org.apache.geronimo.configs connector-deployer connector-deployer-1_6

<= /a>Servlets expecting multipart request

In Servlet 3.0, an annotation @MultiPartConfig has been introduced to in= dicate that the servlet expects request of type multipart. You need to enab= le the feature in your deployment plan file as followed:

geronimo-web.xml
...
   <context allowCasualMultipartParsing=3D"true"></context>
...

Ch= anges regarding EJB component

In Geronimo 3.0, resources are imported and exported using different ele= ments in deployment plan.

For a s= tandalone EJB module

If your EJB application is a standalone module, you need to export its p= ackage in the deployment plan file under name space of http://geronimo.apache.org/xml/ns/deployment-1.2. Fo= r example:

...
   <dep:export-package>ejb.stateful</dep:export-package>
...

While for any modules which call the deployed EJB, you need to import th= e EJB package in the deployment plan using the same name space. For example= :

...
   <dep:import-package>ejb.stateful</dep:import-package>
...

For a web application referring EJB interfaces

If your web application refers to a standalone EJB module, you need to s= pecify the artifact id of the EJB module in the deployment plan file of you= web application. For example:

...
    <nam:ejb-ref>
        <nam:ref-name>ejb/CustomerHom=
e</nam:ref-name>
        <nam:pattern>
            <nam:groupId>wasce-sample=
s</nam:groupId>
            <!--sp=
ecific 3.0.0.0 standalone ejb configuration: ejb jar file name-->=

            <nam:artifactId>mdb-ejb-3=
.0.0.0.jar</nam:artifactId>
            <nam:name>CustomerEJB</nam:name>
        </nam:pattern>
    </nam:ejb-ref>

For= an EJB module embedded in EAR

If an EAR application contains an application client module, an EJB modu= le and web application module. If the application client refers to one of e= jb interfaces using following code:

  @EJB
  private =
static TradeSLSBRemote tradeSLSBRemote;

Although the ejb.jar is defined in its class-path using manifest.mf<= /tt> file, the EJB interface is not in its class path. You need to package= the ejb module into the EAR using the following structure:

  my-ear-3.0.0.0/lib/ejbinterface.jar