geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v3.0 > Migrating from G 2.x to G 3.x
Date Mon, 08 Aug 2011 02:38:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/4/_/styles/combined.css?spaceKey=GMOxDOC30&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Migrating+from+G+2.x+to+G+3.x">Migrating
from G 2.x to G 3.x</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~chirunhua@gmail.com">Runhua
Chi</a>
    </h4>
        <br/>
                         <h4>Changes (30)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">The
following is a guide for converting the deployment descriptors for an application built for
Geronimo 2.x to the appropriate descriptors for Geronimo 3.0.  Other changes might be required
to either the deployment plans or the application itself depending on the application.   <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">CE
3.0 provides backward compatibility to Java EE 5 compliant applications. 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. <br>{toc:maxlevel=1} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">{toc:maxLevel=2}
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h1.
Classloading options in the deployment plan <br>* *hidden-classes* The deployment codes
in Geronimo 3.0 will covert hidden-classes configuration to import-package style. For exmaple,
{{&lt;hidden-classes&gt;javax.faces&lt;/hidden-classes&gt;}} should be {{&lt;import-package&gt;!javax.faces&lt;/import-package&gt;}}.
<br>* *non-overridable-classes* Geronimo 3.0 does not support the element in the deployment
plan. <br>* *private-classes*  Geronimo 3.0 does not support the element in the deployment
plan. <br>* *inverse-classloading* Geronimo 3.0 does not support the element in the
deployment plan.  <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h1.
EAR Project Definition <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h1.
DB initialization at deployment time <br>To initialize a database using deployment plan
file, {{org.apache.geronimo.connector.DatabaseInitializationGBean}} in 2.X should be changed
to {{org.apache.geronimo.connector.wrapper.DatabaseInitializationGBean}}. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3.
application.xml <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h1.
JavaMail session generation and resource lookup <br>There are following changes regarding
Java Mail configuration in Geronimo 3.0. <br>* To generate JavaMaill sessions using
deployment plan file, {{org.apache.geronimo.mail.MailGBean}} in 2.X should be changed to {{org.apache.geronimo.resource.mail.MailGBean}}.
 <br>* 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}}. <br>*
JNDI names of mailGBean should start with {{ger:}}, {{jca:}} or {{java:}} prefix. For example:
<br>{code:xml} <br>   &lt;attribute name=&quot;jndiName&quot;&gt;mail/PlantsByWebSphere&lt;/attribute&gt;
 <br>{code} <br>should be changed to  <br>{code:xml} <br>   &lt;attribute
name=&quot;jndiName&quot;&gt;ger:mail/PlantsByWebSphere&lt;/attribute&gt;
<br>{code} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">No
Changes Required <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h1.
Dependencies changes <br>The following table lists the changes of some components name
from Geronimo 2.x to 3.0. <br>|| groupId || In 2.X|| In 3.0 || <br>| org.apache.geronimo.configs
| client-transaction | client-transaction-1_6 | <br>| org.apache.geronimo.configs |
connector-deployer | connector-deployer-1_6 | <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3.
geronimo-application.xml <br>|| Attribute || Geronimo 1.1 || Geronimo 2.1/2.2 || Geronimo
3.0 || <br>|  xmlns  |  http://geronimo.apache.org/xml/ns/j2ee/application-1.1 | http://geronimo.apache.org/xml/ns/j2ee/application-2.0
 | http://geronimo.apache.org/xml/ns/j2ee/application-2.0  | <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h1.
Servlets expecting multipart request <br>In Servlet 3.0, an annotation @MultiPartConfig
has been introduced to indicate that the servlet expects request of type multipart. You need
to enable the feature in your deployment plan file as followed: <br>{code:title=geronimo-web.xml}
<br>... <br>   &lt;context allowCasualMultipartParsing=&quot;true&quot;&gt;&lt;/context&gt;
<br>... <br>{code} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h1.
Changes regarding EJB component <br>In Geronimo 3.0, resources are imported and exported
using different elements in deployment plan. <br>h2. For a standalone EJB module <br>If
your EJB application is a standalone module, you need to export its package in the deployment
plan file under name space of  {{http://geronimo.apache.org/xml/ns/deployment-1.2}}. For example:
<br>{code:xml} <br>... <br>   &lt;dep:export-package&gt;ejb.stateful&lt;/dep:export-package&gt;
<br>... <br>{code} <br>While for any modules which call the deployed EJB,
you need to import the EJB package in the deployment plan using the same name space. For example:
<br>{code:xml} <br>... <br>   &lt;dep:import-package&gt;ejb.stateful&lt;/dep:import-package&gt;
<br>... <br>{code} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h1.
EJB Project Definition <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h2.
For a web application referring EJB interfaces <br>If your web application refers to
a standalone EJB module, you need to specify the artifact id of the EJB module in the deployment
plan file of you web application. For example: <br>{code:xml} <br>... <br>
   &lt;nam:ejb-ref&gt; <br>        &lt;nam:ref-name&gt;ejb/CustomerHome&lt;/nam:ref-name&gt;
<br>        &lt;nam:pattern&gt; <br>            &lt;nam:groupId&gt;wasce-samples&lt;/nam:groupId&gt;
<br>            &lt;!--specific 3.0.0.0 standalone ejb configuration: ejb jar file
name--&gt; <br>            &lt;nam:artifactId&gt;mdb-ejb-3.0.0.0.jar&lt;/nam:artifactId&gt;
<br>            &lt;nam:name&gt;CustomerEJB&lt;/nam:name&gt; <br>
       &lt;/nam:pattern&gt; <br>    &lt;/nam:ejb-ref&gt; <br>{code}
<br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3.
ejb-jar.xml <br>No Changes Required <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h2.
For an EJB module embedded in EAR <br>If an EAR application contains an application
client module, an EJB module and web application module. If the application client refers
to one of ejb interfaces using following code: <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">
</span> <span class="diff-added-words"style="background-color: #dfd;">{code:java}</span>
<br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3.
openejb-jar.xml <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">
</span> <span class="diff-added-words"style="background-color: #dfd;">@EJB</span>
<br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">||
Attribute || Geronimo 1.1 || Geronimo 2.1/2.2 || Geronimo 3.0 || <br>|  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
 | <br>|  xmlns:nam  |  http://geronimo.apache.org/xml/ns/naming-1.1  | http://geronimo.apache.org/xml/ns/naming-1.2
 |  http://geronimo.apache.org/xml/ns/naming-1.2  | <br>|  xmlns:pkgen  | http://www.openejb.org/xml/ns/pkgen-2.0
 | http://openejb.apache.org/xml/ns/pkgen-2.1  | http://openejb.apache.org/xml/ns/pkgen-2.1
 | <br>|  xmlns:sec  |  http://geronimo.apache.org/xml/ns/security-1.1  | http://geronimo.apache.org/xml/ns/security-2.0
 | http://geronimo.apache.org/xml/ns/security-2.0  | <br>|  xmlns:sys  |  http://geronimo.apache.org/xml/ns/deployment-1.1
 |  http://geronimo.apache.org/xml/ns/deployment-1.2  | http://geronimo.apache.org/xml/ns/deployment-1.2
 | <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
 private static TradeSLSBRemote tradeSLSBRemote; <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">
</span> <span class="diff-added-words"style="background-color: #dfd;">{code}</span>
<br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h1.
WebApp Project Definition <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">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 the ejb module into the EAR using the following
structure: <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">
</span> <span class="diff-added-words"style="background-color: #dfd;">{noformat}</span>
<br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3.
web.xml <br>No Changes Required <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">
</span> <span class="diff-added-words"style="background-color: #dfd;">my-ear-3.0.0.0/lib/ejbinterface.jar</span>
<br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3.
geronimo-web.xml <br>|| Attribute || Geronimo 1.1 || Geronimo 2.1/2.2 || Geronimo 3.0
|| <br>|  xmlns  |  http://geronimo.apache.org/xml/ns/j2ee/web-1.1  |  http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1
 | http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1  | <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{noformat}
<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>CE 3.0 provides backward compatibility to Java EE 5 compliant applications.
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.</p>
<div>
<ul>
    <li><a href='#MigratingfromG2.xtoG3.x-Classloadingoptionsinthedeploymentplan'>Classloading
options in the deployment plan</a></li>
    <li><a href='#MigratingfromG2.xtoG3.x-DBinitializationatdeploymenttime'>DB
initialization at deployment time</a></li>
    <li><a href='#MigratingfromG2.xtoG3.x-JavaMailsessiongenerationandresourcelookup'>JavaMail
session generation and resource lookup</a></li>
    <li><a href='#MigratingfromG2.xtoG3.x-Dependencieschanges'>Dependencies changes</a></li>
    <li><a href='#MigratingfromG2.xtoG3.x-Servletsexpectingmultipartrequest'>Servlets
expecting multipart request</a></li>
    <li><a href='#MigratingfromG2.xtoG3.x-ChangesregardingEJBcomponent'>Changes
regarding EJB component</a></li>
</ul></div>

<h1><a name="MigratingfromG2.xtoG3.x-Classloadingoptionsinthedeploymentplan"></a>Classloading
options in the deployment plan</h1>
<ul>
	<li><b>hidden-classes</b> The deployment codes in Geronimo 3.0 will covert
hidden-classes configuration to import-package style. For exmaple, <tt>&lt;hidden-classes&gt;javax.faces&lt;/hidden-classes&gt;</tt>
should be <tt>&lt;import-package&gt;!javax.faces&lt;/import-package&gt;</tt>.</li>
	<li><b>non-overridable-classes</b> Geronimo 3.0 does not support the element
in the deployment plan.</li>
	<li><b>private-classes</b>  Geronimo 3.0 does not support the element in
the deployment plan.</li>
	<li><b>inverse-classloading</b> Geronimo 3.0 does not support the element
in the deployment plan.</li>
</ul>


<h1><a name="MigratingfromG2.xtoG3.x-DBinitializationatdeploymenttime"></a>DB
initialization at deployment time</h1>
<p>To initialize a database using deployment plan file, <tt>org.apache.geronimo.connector.DatabaseInitializationGBean</tt>
in 2.X should be changed to <tt>org.apache.geronimo.connector.wrapper.DatabaseInitializationGBean</tt>.</p>

<h1><a name="MigratingfromG2.xtoG3.x-JavaMailsessiongenerationandresourcelookup"></a>JavaMail
session generation and resource lookup</h1>
<p>There are following changes regarding Java Mail configuration in Geronimo 3.0.</p>
<ul>
	<li>To generate JavaMaill sessions using deployment plan file, <tt>org.apache.geronimo.mail.MailGBean</tt>
in 2.X should be changed to <tt>org.apache.geronimo.resource.mail.MailGBean</tt>.</li>
	<li>To configure JavaMail SMTP transport protocal using deployment plan file, <tt>org.apache.geronimo.mail.SMTPTransportGBean</tt>
in 2.X should be changed to <tt>org.apache.geronimo.resource.mail.SMTPTransportGBean</tt>.</li>
	<li>JNDI names of mailGBean should start with <tt>ger:</tt>, <tt>jca:</tt>
or <tt>java:</tt> prefix. For example:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
   <span class="code-tag">&lt;attribute name=<span class="code-quote">"jndiName"</span>&gt;</span>mail/PlantsByWebSphere<span
class="code-tag">&lt;/attribute&gt;</span> 
</pre>
</div></div>
<p>should be changed to </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
   <span class="code-tag">&lt;attribute name=<span class="code-quote">"jndiName"</span>&gt;</span>ger:mail/PlantsByWebSphere<span
class="code-tag">&lt;/attribute&gt;</span>
</pre>
</div></div></li>
</ul>


<h1><a name="MigratingfromG2.xtoG3.x-Dependencieschanges"></a>Dependencies
changes</h1>
<p>The following table lists the changes of some components name from Geronimo 2.x to
3.0.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> groupId </th>
<th class='confluenceTh'> In 2.X</th>
<th class='confluenceTh'> In 3.0 </th>
</tr>
<tr>
<td class='confluenceTd'> org.apache.geronimo.configs </td>
<td class='confluenceTd'> client-transaction </td>
<td class='confluenceTd'> client-transaction-1_6 </td>
</tr>
<tr>
<td class='confluenceTd'> org.apache.geronimo.configs </td>
<td class='confluenceTd'> connector-deployer </td>
<td class='confluenceTd'> connector-deployer-1_6 </td>
</tr>
</tbody></table>
</div>


<h1><a name="MigratingfromG2.xtoG3.x-Servletsexpectingmultipartrequest"></a>Servlets
expecting multipart request</h1>
<p>In Servlet 3.0, an annotation @MultiPartConfig has been introduced to indicate that
the servlet expects request of type multipart. You need to enable the feature in your deployment
plan file as followed:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>geronimo-web.xml</b></div><div
class="codeContent panelContent">
<pre class="code-java">
...
   &lt;context allowCasualMultipartParsing=<span class="code-quote">"<span class="code-keyword">true</span>"</span>&gt;&lt;/context&gt;
...
</pre>
</div></div>

<h1><a name="MigratingfromG2.xtoG3.x-ChangesregardingEJBcomponent"></a>Changes
regarding EJB component</h1>
<p>In Geronimo 3.0, resources are imported and exported using different elements in
deployment plan.</p>
<h2><a name="MigratingfromG2.xtoG3.x-ForastandaloneEJBmodule"></a>For a
standalone EJB module</h2>
<p>If your EJB application is a standalone module, you need to export its package in
the deployment plan file under name space of  <tt><a href="http://geronimo.apache.org/xml/ns/deployment-1.2"
class="external-link" rel="nofollow">http://geronimo.apache.org/xml/ns/deployment-1.2</a></tt>.
For example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
...
   <span class="code-tag">&lt;dep:export-package&gt;</span>ejb.stateful<span
class="code-tag">&lt;/dep:export-package&gt;</span>
...
</pre>
</div></div>
<p>While for any modules which call the deployed EJB, you need to import the EJB package
in the deployment plan using the same name space. For example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
...
   <span class="code-tag">&lt;dep:import-package&gt;</span>ejb.stateful<span
class="code-tag">&lt;/dep:import-package&gt;</span>
...
</pre>
</div></div>

<h2><a name="MigratingfromG2.xtoG3.x-ForawebapplicationreferringEJBinterfaces"></a>For
a web application referring EJB interfaces</h2>
<p>If your web application refers to a standalone EJB module, you need to specify the
artifact id of the EJB module in the deployment plan file of you web application. For example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
...
    <span class="code-tag">&lt;nam:ejb-ref&gt;</span>
        <span class="code-tag">&lt;nam:ref-name&gt;</span>ejb/CustomerHome<span
class="code-tag">&lt;/nam:ref-name&gt;</span>
        <span class="code-tag">&lt;nam:pattern&gt;</span>
            <span class="code-tag">&lt;nam:groupId&gt;</span>wasce-samples<span
class="code-tag">&lt;/nam:groupId&gt;</span>
            <span class="code-tag"><span class="code-comment">&lt;!--specific
3.0.0.0 standalone ejb configuration: ejb jar file name--&gt;</span></span>
            <span class="code-tag">&lt;nam:artifactId&gt;</span>mdb-ejb-3.0.0.0.jar<span
class="code-tag">&lt;/nam:artifactId&gt;</span>
            <span class="code-tag">&lt;nam:name&gt;</span>CustomerEJB<span
class="code-tag">&lt;/nam:name&gt;</span>
        <span class="code-tag">&lt;/nam:pattern&gt;</span>
    <span class="code-tag">&lt;/nam:ejb-ref&gt;</span>
</pre>
</div></div>

<h2><a name="MigratingfromG2.xtoG3.x-ForanEJBmoduleembeddedinEAR"></a>For
an EJB module embedded in EAR</h2>
<p>If an EAR application contains an application client module, an EJB module and web
application module. If the application client refers to one of ejb interfaces using following
code:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
  @EJB
  <span class="code-keyword">private</span> <span class="code-keyword">static</span>
TradeSLSBRemote tradeSLSBRemote;
</pre>
</div></div>
<p>Although the ejb.jar is defined in its class-path using <tt>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:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>  my-ear-3.0.0.0/lib/ejbinterface.jar
</pre>
</div></div>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Migrating+from+G+2.x+to+G+3.x">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=20645424&revisedVersion=4&originalVersion=3">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Migrating+from+G+2.x+to+G+3.x?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message