geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hogst...@apache.org
Subject svn commit: r357449 [5/11] - in /geronimo/branches/1.0/modules/scripts/src/resources/docs: ./ Administrative tasks_attachments/ Architecture_attachments/ Configuring LDAP_attachments/ Geronimo Administration Console_attachments/ JBoss to Geronimo - EJB...
Date Sun, 18 Dec 2005 06:06:14 GMT
Added: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-CMP Migration.html
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20EJB-CMP%20Migration.html?rev=357449&view=auto
==============================================================================
--- geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-CMP Migration.html (added)
+++ geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-CMP Migration.html Sat Dec 17 22:04:20 2005
@@ -0,0 +1,553 @@
+<html>
+    <head>
+        <title>Documentation : JBoss to Geronimo - EJB-CMP Migration</title>
+	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
+        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
+    </head>
+
+    <body>
+	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
+		    <tr>
+			    <td valign="top" class="pagebody">
+				    <div class="pageheader">
+					    <span class="pagetitle">
+                            Documentation : JBoss to Geronimo - EJB-CMP Migration
+                                                    </span>
+				    </div>
+				    <div class="pagesubheading">
+					    This page last changed on Dec 14, 2005 by <font color="#0050B2">hcunico@gmail.com</font>.
+				    </div>
+
+				    <p><a name="JBosstoGeronimo-EJB-CMPMigration-top"></a><br/>
+<em><b>Article donated by:</b> <a href="mailto:lenflour@comcast.net" title="Send mail to Leonard Flournoy">Leonard Flournoy</a>, <a href="mailto:hcunico@gmail.com" title="Send mail to Hernan Cunico">Hernan Cunico</a></em></p>
+
+<h1><a name="JBosstoGeronimo-EJB-CMPMigration-Overview"></a>Overview</h1>
+<p>An entity bean is defined as a representation of persistent data that has the ability to read from database and populate its fields with data.  It can be updated and stored back to the database.  There are two types of entity beans: Bean-Managed Persistence(BMP) and Container-Managed Persistent(CMP).  This article covers an example of a CMP, more specifically, a CMP application migration.  For this type of entity bean, actual code must be written to handle persistent operations  such as loading, saving and finding data.  The developer must use persistence API such as JDBC to select, insert, update, delete from a database.</p>
+
+<p>This article is organized in the following sections:</p>
+
+<ul>
+	<li><a href="#JBosstoGeronimo-EJB-CMPMigration-implementation" title="implementation on JBoss to Geronimo - EJB-CMP Migration">CMP implementation analysis</a></li>
+	<li><a href="#JBosstoGeronimo-EJB-CMPMigration-sampleApp" title="sampleApp on JBoss to Geronimo - EJB-CMP Migration">Sample application</a></li>
+	<li><a href="#JBosstoGeronimo-EJB-CMPMigration-JBoss" title="JBoss on JBoss to Geronimo - EJB-CMP Migration">The JBoss environment</a></li>
+	<li><a href="#JBosstoGeronimo-EJB-CMPMigration-Geronimo" title="Geronimo on JBoss to Geronimo - EJB-CMP Migration">The Geronimo environment</a></li>
+	<li><a href="#JBosstoGeronimo-EJB-CMPMigration-migration" title="migration on JBoss to Geronimo - EJB-CMP Migration">Step-by-step migration</a></li>
+	<li><a href="#JBosstoGeronimo-EJB-CMPMigration-summary" title="summary on JBoss to Geronimo - EJB-CMP Migration">Summary</a></li>
+</ul>
+
+
+
+<h1><a name="JBosstoGeronimo-EJB-CMPMigration-CMPimplementationanalysis"></a>CMP implementation analysis <a name="JBosstoGeronimo-EJB-CMPMigration-implementation"></a></h1>
+<p>CMP implementation may vary from one vendor to another. The purpose of this section is to provide a CMP specific feature-to-feature comparison between JBoss v4 and Apache Geronimo so you can clearly identify the differences and plan accordingly before migration.</p>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'>Feature</th>
+<th class='confluenceTh'>JBoss v4</th>
+<th class='confluenceTh'>Apache Geronimo</th>
+</tr>
+<tr>
+<td class='confluenceTd'>EJB Container</td>
+<td class='confluenceTd'>JBoss AS 4.0 comes with its own EJB Container implementation.</td>
+<td class='confluenceTd'>Geronimo uses OpenEJB as its EJB Container.</td>
+</tr>
+</tbody></table>
+
+<p><a href="#JBosstoGeronimo-EJB-CMPMigration-top" title="top on JBoss to Geronimo - EJB-CMP Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-EJB-CMPMigration-Sampleapplication"></a>Sample application <a name="JBosstoGeronimo-EJB-CMPMigration-sampleApp"></a></h1>
+<p>The <a href="JBoss to Geronimo - EJB-CMP Migration_attachments/cmp.zip" title="cmp.zip attached to JBoss to Geronimo - EJB-CMP Migration">Loan CMP Sample</a> application is very simple. When the command line client is run,  an entry is made into the database.  The findByPrimaryKey() method of the CustomerHomeRemote interface is called and the field values of the returned CustomerRemote object are printed to the console.  This is followed by a call to the findBySssNo() method after which  the field values of the returned CustomerRemote object are printed to the console.</p>
+
+<p>The following figure illustrates the application flow:<br/>
+<img src="JBoss to Geronimo - EJB-CMP Migration_attachments/CMP_flow.jpg" align="absmiddle" border="0" /></p>
+
+<p>The user runs the command line client which then either creates an entity bean (which then adds itself to the datasource) or asks for one, by primary key, which is created from information that is stored in the database.</p>
+
+<p><a href="#JBosstoGeronimo-EJB-CMPMigration-top" title="top on JBoss to Geronimo - EJB-CMP Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-CMPMigration-ApplicationBeans"></a>Application Beans</h2>
+<p>The Loan CMP application consists of the following packages:</p>
+
+<ul>
+	<li>com.ibm.demo.entity.client
+	<ul>
+		<li>CMPClient
+		<ul>
+			<li>contains the main class that is called from the console.</li>
+		</ul>
+		</li>
+	</ul>
+	</li>
+	<li>com.ibm.demo.entity.bmp
+	<ul>
+		<li>CustomerBean
+		<ul>
+			<li>implements javax.ejb.EntityBean</li>
+			<li>fields of the bean are defined here</li>
+			<li>contains business methods corresponding to the methods exposed by the CustomerRemote interface.</li>
+			<li>Conatins callback methods that are called by the container to manage the bean.  These methods include the create and find methods which use jdbc to make entries to the database and to search the database.</li>
+			<li>Has a helper method that looks up the datasource through jndi.</li>
+		</ul>
+		</li>
+		<li>CustomerRemote
+		<ul>
+			<li>interface that extends javax.ejb.EJBObject</li>
+			<li>exposes the setter and getter methods of the EJB</li>
+		</ul>
+		</li>
+		<li>CustomerHomeRemote
+		<ul>
+			<li>interface that extends javax.ejb.EJBHome</li>
+			<li>exposes the create and find methods of the EJB</li>
+		</ul>
+		</li>
+	</ul>
+	</li>
+</ul>
+
+
+<p><a href="#JBosstoGeronimo-EJB-CMPMigration-top" title="top on JBoss to Geronimo - EJB-CMP Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-CMPMigration-Toolsused"></a>Tools used</h2>
+<p>The tools used for developing and building the Loan CMP sampple application are:</p>
+
+<h3><a name="JBosstoGeronimo-EJB-CMPMigration-Eclipse"></a>Eclipse</h3>
+<p>The Eclipse IDE was used for development of the sample application. This is a very powerful and popular open source development tool. Integration plug-ins are available for both JBoss and Geronimo. Eclipse can be downloaded from the following URL:</p>
+
+<p><a href="http://www.eclipse.org" title="Visit page outside Confluence">&#104;ttp://www.eclipse.org</a></p>
+
+<h3><a name="JBosstoGeronimo-EJB-CMPMigration-ApacheMaven"></a>Apache Maven</h3>
+<p>Maven is a software project management and comprehension tool. Based on the concept of a project object model (<a href="http://maven.apache.org/reference/glossary.html#POM" title="Visit page outside Confluence">POM</a>). Maven can manage a project's build, reporting and documentation from a central piece of information.</p>
+
+<p>For this migration example Maven 1.0.2 was used. Maven can be downloaded from the followinf URL:</p>
+
+<p><a href="http://maven.apache.org" title="Visit page outside Confluence">&#104;ttp://maven.apache.org</a></p>
+
+<p><a href="#JBosstoGeronimo-EJB-CMPMigration-top" title="top on JBoss to Geronimo - EJB-CMP Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-CMPMigration-Sampledatabase"></a>Sample database</h2>
+<p>The sample database for the Loan CMP application has only one table. This is an in-memory table. The <b>MEMORY</b> storage engine creates tables with contents that are stored in just in memory. These were formerly known as HEAP tables.</p>
+
+<p>The following table describes the fields of the <b>CUSTOMER</b> table.</p>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'>Field</th>
+<th class='confluenceTh'>data type</th>
+</tr>
+<tr>
+<td class='confluenceTd'>id</td>
+<td class='confluenceTd'>INTEGER</td>
+</tr>
+<tr>
+<td class='confluenceTd'>name</td>
+<td class='confluenceTd'>VARCHAR(45)</td>
+</tr>
+<tr>
+<td class='confluenceTd'>birthdate</td>
+<td class='confluenceTd'>DATE</td>
+</tr>
+<tr>
+<td class='confluenceTd'>sss_no</td>
+<td class='confluenceTd'>VARCHAR(25)</td>
+</tr>
+<tr>
+<td class='confluenceTd'>address</td>
+<td class='confluenceTd'>VARCHAR(60)</td>
+</tr>
+<tr>
+<td class='confluenceTd'>annual_salary</td>
+<td class='confluenceTd'>DOUBLE</td>
+</tr>
+<tr>
+<td class='confluenceTd'>loan_amount</td>
+<td class='confluenceTd'>DOUBLE</td>
+</tr>
+</tbody></table>
+
+<p><a href="#JBosstoGeronimo-EJB-CMPMigration-top" title="top on JBoss to Geronimo - EJB-CMP Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-EJB-CMPMigration-TheJBossenvironment"></a>The JBoss environment <a name="JBosstoGeronimo-EJB-CMPMigration-JBoss"></a></h1>
+<p>This section shows you how and where the sample JBoss reference environment was installed so you can map this scenario to your own implementation. Note that for this migration example JBoss v4.0.2 was used.</p>
+
+<p>Detailed instructions for installing, configuring, and managing JBoss are provided in the product documentation. Check the product Web site for the most updated documents.</p>
+
+<p>The following list highlights the general tasks you will need to complete to install and configure the initial environment as the starting point for deploying the sample application.</p>
+
+<ol>
+	<li>Download and install JBoss v4 as explained in the product documentation guides. From now on the installation directory will be referred as <b>&lt;jboss_home&gt;</b></li>
+	<li>Create a copy of the default JBoss v4 application server. Copy recursively <b>&lt;jboss_home&gt;\server\default</b> to <b>&lt;jboss_home&gt;\server\&lt;your_server_name&gt;</b></li>
+	<li>Start the new server by running the <tt>run.sh -c &lt;your_server_name&gt;</tt> command from the <b>&lt;jboss_home&gt;\bin</b> directory.</li>
+	<li>Once the server is started, you can verify that it is running by opening a Web browser and pointing it to this URL: <a href="http://localhost:8080" title="Visit page outside Confluence">&#104;ttp://localhost:8080</a>. You should see the JBoss Welcome window and be able to access the JBoss console.</li>
+	<li>Once the application server is up and running, the next step is to install and configure all the remaining prerequisite software required by the sample application. This step is described in the following section.</li>
+</ol>
+
+
+<p><a href="#JBosstoGeronimo-EJB-CMPMigration-top" title="top on JBoss to Geronimo - EJB-CMP Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-CMPMigration-Installandconfigureprerequisitesoftware"></a>Install and configure prerequisite software</h2>
+<p>In order to build and run the Loan CMP application included in this article, you need to install and configure the build tool and the database that is used by the application. </p>
+
+<h3><a name="JBosstoGeronimo-EJB-CMPMigration-Modifydatabasesettings"></a>Modify database settings</h3>
+<p>This application is using the HSQL database that comes as part of the JBoss bundle. You need to modify the script for creating the database. Edit the <b>localDB.script</b> file located in the following directory:</p>
+
+<p>&lt;jboss_home&gt;\server\&lt;your_server_name&gt;\data\hypersonic</p>
+
+<p>Add at the top of the <b>localDB.script</b> file the content of the following example in order to create the sample HSQL database.</p>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Make sure JBoss is not running at the time of modifying this file.</b></td></tr></table>
+
+<p><tt>CREATE MEMORY TABLE CUSTOMER(ID INTEGER NOT NULL PRIMARY KEY,NAME VARCHAR(45),BIRTHDATE DATE,SSS_NO VARCHAR(25),ADDRESS VARCHAR(60),ANNUAL_SALARY DOUBLE,LOAN_AMOUNT DOUBLE)</tt></p>
+
+<h3><a name="JBosstoGeronimo-EJB-CMPMigration-ConfigureMaven"></a>Configure Maven</h3>
+<p>As mentioned before, Apache Maven is used to build the binaries for the Loan CMP application. If you do not have Maven installed this is a good time for doing it.</p>
+
+<p>Apache Maven can be downloaded from the following URL:</p>
+
+<p><a href="http://maven.apache.org" title="Visit page outside Confluence">&#104;ttp://maven.apache.org</a></p>
+
+<p><a href="#JBosstoGeronimo-EJB-CMPMigration-top" title="top on JBoss to Geronimo - EJB-CMP Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-CMPMigration-Buildthesampleapplication"></a>Build the sample application</h2>
+<p>In order to build the loan application a Maven script has been provided. Download the Loan application from the following link:</p>
+
+<p><a href="JBoss to Geronimo - EJB-CMP Migration_attachments/cmp.zip" title="cmp.zip attached to JBoss to Geronimo - EJB-CMP Migration">Loan CMP Sample</a></p>
+
+<p>After extracting the zip file, a <b>loan-cmp</b> directory will be created. From now on, this directory will be referred as &lt;cmp_home&gt;. In that directory open the project.properties file.  Edit the maven.jboss.home property to match your environment. It is important that you use <b>"//"</b> on the windows platform as is done below. </p>
+
+<p><b>maven.jboss.home=Z://JBoss-4.0.2</b></p>
+
+<p>From a command prompt or shell go to the &lt;cmp_home&gt; directory and run the following command:</p>
+
+<p><b><tt>maven</tt></b></p>
+
+<p>This will build a jar and a war file and put them in the &lt;cmp_home&gt;/target folder. The jar created by the Maven build contains a JBoss specific deployment descriptor, the <b>jboss.xml</b> file in located the META-INF directory of the JAR is shown in the following example:</p>
+
+<div class="code" style="border-style: solid; "><div class="codeHeader" style="border-bottom-style: solid; "><b>JBoss deployment descriptor - jboss.xml</b></div><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;?xml version=<span class="code-quote">"1.0"</span>?&gt;</span>
+
+<span class="code-tag">&lt;jboss&gt;</span>
+   <span class="code-tag">&lt;enterprise-beans&gt;</span>
+      <span class="code-tag">&lt;entity&gt;</span>
+         <span class="code-tag">&lt;ejb-name&gt;</span>CustomerEJB<span class="code-tag">&lt;/ejb-name&gt;</span>
+         <span class="code-tag">&lt;jndi-name&gt;</span>CustomerHomeRemote<span class="code-tag">&lt;/jndi-name&gt;</span>
+      <span class="code-tag">&lt;/entity&gt;</span>
+   <span class="code-tag">&lt;/enterprise-beans&gt;</span>
+<span class="code-tag">&lt;/jboss&gt;</span></pre>
+</div></div>
+
+<p>The jndi-name element is used to bind the CustomerEJB to the name CustomerHomeRemote in JNDI.</p>
+
+<p>Running <b><tt>maven</tt></b> will also build the a war file and put it in the &lt;cmp_home&gt;/target folder. The war created by the maven build contains a JBoss specific Web application deployment descriptor, the jboss-web.xml file in the WEB-INF directory of the WAR is shown in the following example:</p>
+
+<div class="code" style="border-style: solid; "><div class="codeHeader" style="border-bottom-style: solid; "><b>JBoss deployment descriptor - jboss.xml</b></div><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;?xml version=<span class="code-quote">"1.0"</span> encoding=<span class="code-quote">"UTF-8"</span>?&gt;</span>
+<span class="code-tag">&lt;jboss-web&gt;</span>
+    <span class="code-tag">&lt;ejb-ref&gt;</span>
+        <span class="code-tag">&lt;ejb-ref-name&gt;</span>ejb/CustomerHome<span class="code-tag">&lt;/ejb-ref-name&gt;</span>
+        <span class="code-tag">&lt;jndi-name&gt;</span>CustomerHomeRemote<span class="code-tag">&lt;/jndi-name&gt;</span>
+    <span class="code-tag">&lt;/ejb-ref&gt;</span>
+<span class="code-tag">&lt;/jboss-web&gt;</span></pre>
+</div></div>
+
+<p><a href="#JBosstoGeronimo-EJB-CMPMigration-top" title="top on JBoss to Geronimo - EJB-CMP Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-CMPMigration-Deploythesampleapplication"></a>Deploy the sample application</h2>
+<p>To deploy the Loan CMP application  in JBoss, copy the <b>entity-ejb-cmp.jar</b> and <b>entity-ejb.war</b> files you just built with Maven to the following directory:</p>
+
+<p>&lt;jboss_home&gt;\server\&lt;your_server_name&gt;\deploy</p>
+
+<p>If JBoss is already started, it will automatically deploy and start the application; otherwise, the application will be deployed and started at the next startup. </p>
+
+<p><a href="#JBosstoGeronimo-EJB-CMPMigration-top" title="top on JBoss to Geronimo - EJB-CMP Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-CMPMigration-Testthesampleapplication"></a>Test the sample application</h2>
+<p>To test the sample client application type the following command from the &lt;cmp_home&gt; directory:</p>
+
+<p><b><tt>maven run:client</tt></b></p>
+
+<p>When you run this command, you will receive a list of all the loans that were retireved from the database, you should see a screen similar to the one shown in the following example:</p>
+
+<p><font color="white"><div class="preformatted" style="border-style: solid; "><div class="preformattedContent" style="background-color: #000000; ">
+<pre>E:\loan-cmp&gt;maven run:client
+ __  __
+|  \/  |__ _Apache__ ___
+| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
+|_|  |_\__,_|\_/\___|_||_|  v. 1.0.2
+
+build:start:
+
+run:client:
+    [java] creating home...
+    [java] creating customer...
+    [java] INSERTING RECORD :1, Customer 1, 11/11/11,  2323232 , NO INFO,  0.0 , 0.0
+    [java] DONE WITH THE INSERT
+    [java] done.findByPrimaryKeyTest... 1
+    [java] customer name: Customer 1
+    [java] customer sss no: 2323232
+    [java] customer loan amount: 0.0
+    [java] customer annual salary: 0.0
+    [java] customer birthdate: Fri Nov 11 00:00:00 EST 2011
+    [java] updating ejb...
+    [java] done.findBySssNoTest... 2323232
+    [java] customer name: Customer 2
+    [java] customer sss no: 2323232
+    [java] customer loan amount: 0.0
+    [java] customer annual salary: 0.0
+    [java] customer birthdate: Fri Nov 11 00:00:00 EST 2011
+BUILD SUCCESSFUL
+Total time: 4 seconds
+Finished at: Thu Nov 10 13:32:33 EST 2005
+
+E:\loan-cmp&gt;</pre>
+</div></div></font></p>
+
+<p>To test the sample Web application point your browser to: </p>
+
+<p><a href="http://localhost:8080/entity-ejb" title="Visit page outside Confluence">&#104;ttp://localhost:8080/entity-ejb</a></p>
+
+<p>You should see the following screen:</p>
+
+<p><img src="JBoss to Geronimo - EJB-CMP Migration_attachments/BMP_JB_test.jpg" align="absmiddle" border="0" /></p>
+
+<p>Click on <b>Add Customer</b>. Enter the new customer information then click <b>Create</b>, this will take you to the first page showing the updated list of customers.</p>
+<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td> When you are entering the <b>BIRTHDATE</b> make sure you spesify the date with the following format (MM/DD/YYYY)</td></tr></table>
+
+<p><a href="#JBosstoGeronimo-EJB-CMPMigration-top" title="top on JBoss to Geronimo - EJB-CMP Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-EJB-CMPMigration-TheGeronimoenvironment"></a>The Geronimo environment <a name="JBosstoGeronimo-EJB-CMPMigration-Geronimo"></a></h1>
+<p>Download and install Geronimo from the following URL:</p>
+
+<p><a href="http://geronimo.apache.org/downloads.html" title="Visit page outside Confluence">&#104;ttp://geronimo.apache.org/downloads.html</a></p>
+
+<p>The release notes available there provide clear instructions on system requirements and how to install and start Geronimo.  Throughout the rest of this article we will refer to the Geronimo installation directory as <b>&lt;geronimo_home&gt;</b>.</p>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='warningMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">TCP/IP ports conflict</b><br />If you are planning to run JBoss and Geronimo on the same machine consider to change the default service ports on, at least, one of these servers.</td></tr></table>
+
+<p><a href="#JBosstoGeronimo-EJB-CMPMigration-top" title="top on JBoss to Geronimo - EJB-CMP Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-CMPMigration-Configureresources"></a>Configure resources</h2>
+<p>For this scenario the Loan CMP will use directly the SystemDatabase from Geronimo. In this case there is no need to set up a new connector for the SystemDatabase since it is already configured as the DefaultDatasource.</p>
+
+<h3><a name="JBosstoGeronimo-EJB-CMPMigration-StarttheGeronimoserver"></a>Start the Geronimo server</h3>
+<p>Ensure that Geronimo is up and running. If the server has not been started yet, do so by typing the following command:</p>
+
+<p><tt>&lt;geronimo_home&gt;/bin/startup.sh</tt></p>
+
+<p>Once the server is started you should see a screen similar as the one illustrated in the following example:</p>
+
+<p><font color="white"><div class="preformatted" style="border-style: solid; "><div class="preformattedContent" style="background-color: #000000; ">
+<pre>E:\geronimo\bin&gt;startup
+Booting Geronimo Kernel (in Java 1.4.2_09)...
+Starting Geronimo Application Server
+[*************] 100%  32s Startup complete
+  Listening on Ports:
+    1099 0.0.0.0 RMI Naming
+    1527 0.0.0.0 Derby Connector
+    4201 0.0.0.0 ActiveIO Connector EJB
+    4242 0.0.0.0 Remote Login Listener
+    8019 0.0.0.0 Tomcat Connector AJP
+    8080 0.0.0.0 Jetty Connector HTTP
+    8090 0.0.0.0 Tomcat Connector HTTP
+    8443 0.0.0.0 Jetty Connector HTTPS
+    8453 0.0.0.0 Tomcat Connector HTTPS
+   61616 0.0.0.0 ActiveMQ Message Broker Connector
+  Started Application Modules:
+    EAR: org/apache/geronimo/Console
+    WAR: org/apache/geronimo/applications/Welcome
+  Web Applications:
+    http://hcunico:8080/
+    http://hcunico:8080/console
+    http://hcunico:8080/console-standard
+Geronimo Application Server started</pre>
+</div></div></font></p>
+
+<h3><a name="JBosstoGeronimo-EJB-CMPMigration-ConfiguredatabaseviaGeronimoConsole"></a>Configure database via Geronimo Console</h3>
+<p>Access the Geronimo Console by pointing your Web browser to the following URL:</p>
+
+<p><a href="http://localhost:8080/console" title="Visit page outside Confluence">&#104;ttp://localhost:8080/console</a></p>
+
+<p>Enter the following <b>system</b> as the username and <b>manager</b> as the password, click <b>Login</b>.</p>
+
+<p>Once logged in, on the bottom left corner from the left navigation panel click on <b>DB Manager</b>. In the text area labeled <b>SQL Command/s</b> enter the following SQL statement and click <b>Run SQL</b>; this will create the table used by the Entity Bean.</p>
+
+<p><tt>CREATE TABLE CUSTOMER(ID INTEGER NOT NULL PRIMARY KEY,NAME VARCHAR(45),BIRTHDATE DATE,SSS_NO VARCHAR(25),ADDRESS VARCHAR(60),ANNUAL_SALARY DOUBLE,LOAN_AMOUNT DOUBLE)</tt></p>
+
+<p><img src="JBoss to Geronimo - EJB-CMP Migration_attachments/BMP-console-DB.jpg" align="absmiddle" border="0" /></p>
+
+<p><a href="#JBosstoGeronimo-EJB-CMPMigration-top" title="top on JBoss to Geronimo - EJB-CMP Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-EJB-CMPMigration-Stepbystepmigration"></a>Step-by-step migration <a name="JBosstoGeronimo-EJB-CMPMigration-migration"></a></h1>
+
+<p>The same EJB jar file that was created and deployed in JBoss may be deployed in Geronimo with no changes to its contents but you still need to edit the jndi properties of sample application. Edit the <b>jndi.properties</b> file located in in the &lt;cmp_home&gt;/jndi directory as shown in the following example:</p>
+
+<div class="preformatted" style="border-style: solid; "><div class="preformattedHeader" style="border-bottom-style: solid; "><b>jndi.properties</b></div><div class="preformattedContent">
+<pre>####################################################################
+### JBoss Settings
+####################################################################
+#java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+#java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+#java.naming.provider.url=localhost
+
+
+####################################################################
+### Geronimo Settings
+####################################################################
+java.naming.factory.initial=org.openejb.client.RemoteInitialContextFactory
+java.naming.provider.url=localhost:4201
+java.naming.security.principal=username
+java.naming.security.credentials=passwd</pre>
+</div></div>
+
+<p>The following example shows the <b>customer-ejb.xml</b> deployment plan used for deploying the EJB application, this deployment plan in located in the &lt;cmp_home&gt;/dd directory.</p>
+
+<div class="code" style="border-style: solid; "><div class="codeHeader" style="border-bottom-style: solid; "><b>customer-ejb.xml</b></div><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;?xml version=<span class="code-quote">"1.0"</span> encoding=<span class="code-quote">"UTF-8"</span>?&gt;</span>
+
+&lt;openejb-jar
+    xmlns=<span class="code-quote">"http://www.openejb.org/xml/ns/openejb-jar"</span>
+    <span class="code-keyword">xmlns:naming</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/naming"</span>
+    <span class="code-keyword">xmlns:security</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/security"</span>
+    <span class="code-keyword">xmlns:sys</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment"</span>
+    configId=<span class="code-quote">"CustomerEJB"</span>
+    parentId=<span class="code-quote">"org/apache/geronimo/SystemDatabase"</span>&gt;
+<span class="code-tag">&lt;enterprise-beans&gt;</span>
+    <span class="code-tag">&lt;entity&gt;</span>
+        <span class="code-tag">&lt;ejb-name&gt;</span>CustomerEJB<span class="code-tag">&lt;/ejb-name&gt;</span>
+        <span class="code-tag">&lt;jndi-name&gt;</span>CustomerHomeRemote<span class="code-tag">&lt;/jndi-name&gt;</span>
+        <span class="code-tag">&lt;local-jndi-name&gt;</span>CustomerRemote<span class="code-tag">&lt;/local-jndi-name&gt;</span>
+        <span class="code-tag">&lt;resource-ref&gt;</span>
+            <span class="code-tag">&lt;ref-name&gt;</span>jdbc/ibm-demo<span class="code-tag">&lt;/ref-name&gt;</span>
+            <span class="code-tag">&lt;resource-link&gt;</span>SystemDatasource<span class="code-tag">&lt;/resource-link&gt;</span>
+        <span class="code-tag">&lt;/resource-ref&gt;</span>
+    <span class="code-tag">&lt;/entity&gt;</span>
+<span class="code-tag">&lt;/enterprise-beans&gt;</span>
+<span class="code-tag">&lt;/openejb-jar&gt;</span></pre>
+</div></div>
+
+<p>This plan sets <b>org/apache/geronimo/SystemDatabase</b> as the parent.  What follows is the definition of the entity bean.  The <b>jndi-name</b> element indicates the jndi name of the entity bean's home interface <b>CustomerHomeRemote</b>.   This is the name that the Loan CMP sample application will lookup in the jndi context.  The element <b>local-jndi-name</b> indicates the jndi name of the local interface, which in this case happens to be a remote interface, <b>CustomerRemote</b>.  Next, a reference to the <b>SystemDatasource</b> is defined giving the application access to the database.</p>
+
+<p>The Web Application client can be direclty deployed in Geronimo. This is because the build step packages both the JBoss <b>jboss-web.xml</b> and Geronimo <b>geronimo-web.xml</b> specific deployment plans in the war file. You can see both of these files in the &lt;cmp_home&gt;\src\webapp\WEB-INF directory.</p>
+
+<p>The <b>geronimo-web.xml</b> deployment plan should look like the following example.</p>
+
+<div class="code" style="border-style: solid; "><div class="codeHeader" style="border-bottom-style: solid; "><b>Geronimo deployment plan geronimo-web.xml</b></div><div class="codeContent">
+<pre class="code-xml">&lt;web-app xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/web"</span>
+         <span class="code-keyword">xmlns:naming</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/naming"</span>
+         configId=<span class="code-quote">"EntityDemoWebApp"</span>
+         parentId=<span class="code-quote">"CustomerEJB"</span>&gt;
+         
+     <span class="code-tag">&lt;context-root&gt;</span>entity-ejb<span class="code-tag">&lt;/context-root&gt;</span>    
+     
+    <span class="code-tag">&lt;ejb-ref&gt;</span>
+        <span class="code-tag">&lt;ref-name&gt;</span>ejb/CustomerHome<span class="code-tag">&lt;/ref-name&gt;</span>
+        <span class="code-tag">&lt;target-name&gt;</span>geronimo.server:EJBModule=CustomerEJB,J2EEApplication=null,J2EEServer=geronimo,j2eeType=EntityBean,name=CustomerEJB<span class="code-tag">&lt;/target-name&gt;</span>
+    <span class="code-tag">&lt;/ejb-ref&gt;</span>
+       
+<span class="code-tag">&lt;/web-app&gt;</span></pre>
+</div></div>
+
+<p>Build the Loan CMP application by typing <b>maven</b> from the &lt;cmp_home&gt; directory. This will create the <b>entity-ejb-cmp.jar</b> and <b>entity-ejb.war</b> in the &lt;cmp_home&gt;/target directory.</p>
+
+<p><a href="#JBosstoGeronimo-EJB-CMPMigration-top" title="top on JBoss to Geronimo - EJB-CMP Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-CMPMigration-Deploythemigratedapplication"></a>Deploy the migrated application</h2>
+<p>To deploy the migrated Loan CMP application, make sure the Geronimo server is up and running. </p>
+
+<p>From a command line, change directory to &lt;geronimo_home&gt; and type the following command:</p>
+
+<p><b><tt>java -jar bin/deployer.jar --user system --password manager deploy &lt;cmp_home&gt;/target/entity-ejb-cmp.jar &lt;cmp_home&gt;/dd/customer-ejb.xml</tt></b></p>
+
+<p>With this command you first tell the deployer tool where is the module to deploy, then you tell the deployer tool how to deploy the application by specifying the deployment plan.</p>
+
+<p>Deploy the Web Application by typing the following command:</p>
+
+<p><b><tt>java -jar bin/deployer.jar --user system --password manager deploy &lt;cmp_home&gt;/target/entity-ejb.war</tt></b></p>
+
+<p>From the command line change the the &lt;cmp_home&gt; directory and type the following command:</p>
+
+<p><b><tt>maven run:client</tt></b></p>
+
+<p>You should see something similar to the following example:</p>
+
+<p><font color="white"><div class="preformatted" style="border-style: solid; "><div class="preformattedContent" style="background-color: #000000; ">
+<pre>E:\loan-cmp&gt;maven run:client
+ __  __
+|  \/  |__ _Apache__ ___
+| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
+|_|  |_\__,_|\_/\___|_||_|  v. 1.0.2
+
+build:start:
+
+run:client:
+    [java] creating home...
+    [java] creating customer...
+    [java] INSERTING RECORD :1, Customer 1, 11/11/11,  2323232 , NO INFO,  0.0 , 0.0
+    [java] DONE WITH THE INSERT
+    [java] done.findByPrimaryKeyTest... 1
+    [java] customer name: Customer 1
+    [java] customer sss no: 2323232
+    [java] customer loan amount: 0.0
+    [java] customer annual salary: 0.0
+    [java] customer birthdate: 2011-11-11
+    [java] updating ejb...
+    [java] done.findBySssNoTest... 2323232
+    [java] customer name: Customer 2
+    [java] customer sss no: 2323232
+    [java] customer loan amount: 0.0
+    [java] customer annual salary: 0.0
+    [java] customer birthdate: 2011-11-11
+BUILD SUCCESSFUL
+Total time: 4 seconds
+Finished at: Mon Nov 14 10:57:15 EST 2005</pre>
+</div></div></font></p>
+
+<p>Test the applications the same way you tested on JBoss.</p>
+
+<p><a href="#JBosstoGeronimo-EJB-CMPMigration-top" title="top on JBoss to Geronimo - EJB-CMP Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-EJB-CMPMigration-Summary"></a>Summary <a name="JBosstoGeronimo-EJB-CMPMigration-summary"></a></h1>
+<p>This article has shown you how to migrate a sample application, from JBoss to the Apache Geronimo application server. You followed step-by-step instructions to build the application, deploy and run it, and then migrate it to the Geronimo environment.<br/>
+The following list summarizes the major differences found during this sample application migration.</p>
+<ul>
+	<li>In the Geronimo specific deployment descriptor the ejbreference name is mapped to the gbean name of the ejb unlike in the JBoss specific deployment descriptor where the resource name is mapped to the JNDI name of the ejb.</li>
+	<li>In order to deploy a datasource in JBoss you need to just copy the configuration file to the deploy directory but in Geronimo you need to use the deployer tool or the Web console.</li>
+</ul>
+
+
+
+<p><a href="#JBosstoGeronimo-EJB-CMPMigration-top" title="top on JBoss to Geronimo - EJB-CMP Migration">Back to Top</a></p>
+
+				    					    <br/>
+                        <div class="tabletitle">
+                            <a name="attachments">Attachments:</a>
+                        </div>
+
+                        <div class="greybox" align="left">
+                                                            <img src="icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="JBoss to Geronimo - EJB-CMP Migration_attachments/BMP_JB_test.jpg">BMP_JB_test.jpg</a> (image/pjpeg)
+                                <br/>
+                                                            <img src="icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="JBoss to Geronimo - EJB-CMP Migration_attachments/BMP-console-DB.jpg">BMP-console-DB.jpg</a> (image/pjpeg)
+                                <br/>
+                                                            <img src="icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="JBoss to Geronimo - EJB-CMP Migration_attachments/cmp.zip">cmp.zip</a> (application/x-zip-compressed)
+                                <br/>
+                                                            <img src="icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="JBoss to Geronimo - EJB-CMP Migration_attachments/CMP_flow.jpg">CMP_flow.jpg</a> (image/pjpeg)
+                                <br/>
+                                                    </div>
+				    
+                    			    </td>
+		    </tr>
+	    </table>
+	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
+			<tr>
+				<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
+			</tr>
+		    <tr>
+			    <td align="center"><font color="grey">Document generated by Confluence on Dec 15, 2005 19:14</font></td>
+		    </tr>
+	    </table>
+    </body>
+</html>
\ No newline at end of file

Added: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-CMP Migration_attachments/BMP-console-DB.jpg
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20EJB-CMP%20Migration_attachments/BMP-console-DB.jpg?rev=357449&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-CMP Migration_attachments/BMP-console-DB.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-CMP Migration_attachments/BMP_JB_test.jpg
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20EJB-CMP%20Migration_attachments/BMP_JB_test.jpg?rev=357449&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-CMP Migration_attachments/BMP_JB_test.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-CMP Migration_attachments/CMP_flow.jpg
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20EJB-CMP%20Migration_attachments/CMP_flow.jpg?rev=357449&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-CMP Migration_attachments/CMP_flow.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-CMP Migration_attachments/cmp.zip
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20EJB-CMP%20Migration_attachments/cmp.zip?rev=357449&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-CMP Migration_attachments/cmp.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-MDB Migration.html
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20EJB-MDB%20Migration.html?rev=357449&view=auto
==============================================================================
--- geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-MDB Migration.html (added)
+++ geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-MDB Migration.html Sat Dec 17 22:04:20 2005
@@ -0,0 +1,603 @@
+<html>
+    <head>
+        <title>Documentation : JBoss to Geronimo - EJB-MDB Migration</title>
+	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
+        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
+    </head>
+
+    <body>
+	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
+		    <tr>
+			    <td valign="top" class="pagebody">
+				    <div class="pageheader">
+					    <span class="pagetitle">
+                            Documentation : JBoss to Geronimo - EJB-MDB Migration
+                                                    </span>
+				    </div>
+				    <div class="pagesubheading">
+					    This page last changed on Dec 14, 2005 by <font color="#0050B2">hcunico@gmail.com</font>.
+				    </div>
+
+				    <p><a name="JBosstoGeronimo-EJB-MDBMigration-top"></a><br/>
+<em><b>Article donated by:</b> <a href="mailto:cpineda@exist.com" title="Send mail to Cata Pineda">Cata Pineda</a>, <a href="mailto:lenflour@comcast.net" title="Send mail to Leonard Flournoy">Leonard Flournoy</a>, <a href="mailto:hcunico@gmail.com" title="Send mail to Hernan Cunico">Hernan Cunico</a></em></p>
+
+<h1><a name="JBosstoGeronimo-EJB-MDBMigration-Overview"></a>Overview</h1>
+<p>Before looking at Message Driven Beans (MDBs) a brief overview of the Java Messaging Service (JMS) API is in order. JMS is a way for applications to send and receive messages. </p>
+
+<p>There are three distinct components in JMS:</p>
+
+<ul>
+	<li>A destination - is where messages are sent.</li>
+	<li>A publisher - sends messages to a destination.</li>
+	<li>A subscriber - tells a destination that it is interested in receiving messages that are sent to the destination. In other words a subscriber recieves messages that are sent to a destination.</li>
+</ul>
+
+
+<p>For more details on the JMS API see the JCP Specification at the following URL:</p>
+
+<p><a href="http://jcp.org/aboutJava/communityprocess/final/jsr914/index.html" title="Visit page outside Confluence">&#104;ttp://jcp.org/aboutJava/communityprocess/final/jsr914/index.html</a></p>
+
+<p>MDBs are different from other Enterprise JavaBeans because clients/users of MDBs, typically do not interact directly with MDBs. Instead they send messages to a JMS Destination and, if the MDB is a registered listener of this destination, the MDB recieves the message and acts accordingly.</p>
+
+<p>This article is organized in the following sections:</p>
+
+<ul>
+	<li><a href="#JBosstoGeronimo-EJB-MDBMigration-implementation" title="implementation on JBoss to Geronimo - EJB-MDB Migration">MDB implementation analysis</a></li>
+	<li><a href="#JBosstoGeronimo-EJB-MDBMigration-sampleApp" title="sampleApp on JBoss to Geronimo - EJB-MDB Migration">Sample application</a></li>
+	<li><a href="#JBosstoGeronimo-EJB-MDBMigration-JBoss" title="JBoss on JBoss to Geronimo - EJB-MDB Migration">The JBoss environment</a></li>
+	<li><a href="#JBosstoGeronimo-EJB-MDBMigration-Geronimo" title="Geronimo on JBoss to Geronimo - EJB-MDB Migration">The Geronimo environment</a></li>
+	<li><a href="#JBosstoGeronimo-EJB-MDBMigration-migration" title="migration on JBoss to Geronimo - EJB-MDB Migration">Step-by-step migration</a></li>
+	<li><a href="#JBosstoGeronimo-EJB-MDBMigration-summary" title="summary on JBoss to Geronimo - EJB-MDB Migration">Summary</a></li>
+</ul>
+
+
+
+<h1><a name="JBosstoGeronimo-EJB-MDBMigration-MDBimplementationanalysis"></a>MDB implementation analysis <a name="JBosstoGeronimo-EJB-MDBMigration-implementation"></a></h1>
+<p>EJB implementations may vary from one vendor to another. The purpose of this section is to provide an EJB specific feature-to-feature comparison between JBoss v4 and Apache Geronimo so you can clearly identify the differences and plan accordingly before migration.</p>
+
+<p>Given that MDBs are dependent on parts of the Java Messaging Service API (JMS), there will be an overlap of some JMS features when comparing the platform specific MDB features.</p>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'>Features</th>
+<th class='confluenceTh'>JBoss v4</th>
+<th class='confluenceTh'>Apache Geronimo</th>
+</tr>
+<tr>
+<td class='confluenceTd'>EJB Container</td>
+<td class='confluenceTd'>JBoss AS 4.0 comes with its own EJB Container implementation.</td>
+<td class='confluenceTd'>Geronimo uses OpenEJB as its EJB Container.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>JMS implementation</td>
+<td class='confluenceTd'>JBoss AS 4.0 is packaged with JBoss MQ.</td>
+<td class='confluenceTd'>Geronimo uses ActiveMQ as its JMS implementation.</td>
+</tr>
+</tbody></table>
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-EJB-MDBMigration-Sampleapplication"></a>Sample application <a name="JBosstoGeronimo-EJB-MDBMigration-sampleApp"></a></h1>
+<p>The <a href="http://localhost:9090/download/attachments/1570/mdb.zip?version=1" title="mdb.zip attached to JBoss to Geronimo - EJB-MDB Migration">MDB Sample Application</a> creates an Entity Bean from the information stored in the messages that it recieves. There is also a sample "client" that sends messages to a destination. This sample application implements javax.ejb.MessageDrivenBean and javax.jms.MessageListener. All of the work is done in the onMessage method, which is called by the container when a message is received.</p>
+
+<p>The following figure illustrates the application flow:<br/>
+<img src="JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_flow.jpg" align="absmiddle" border="0" /></p>
+
+<p>The user accesses the command line client and is prompted for the appropriate information. The information is then packaged into a JMS message and sent to a JMS destination. The Message Driven Bean then recieves messages that are sent to the JMS  Destination that it is configured to listen to and creates an entity bean based on the information from the message. The entity bean then adds it's information to the data souce.</p>
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-MDBMigration-Applicationclasses"></a>Application classes</h2>
+<p>The MDB application consists of the following packages:</p>
+
+<ul>
+	<li>com.ibm.demo.mdb.client
+	<ul>
+		<li>MessageSender
+		<ul>
+			<li>Contains the main class that is called from the console.</li>
+			<li>Pprompts for user input to populate the message.</li>
+		</ul>
+		</li>
+	</ul>
+	</li>
+	<li>com.ibm.demo.mdb.ejb
+	<ul>
+		<li>SampleMDB
+		<ul>
+			<li>Implements javax.ejb.MessageDrivenBean and javax.jms.MessageListener</li>
+			<li>Has empty implementations of the methods of javax.ejb.MessageDrivenBean</li>
+			<li>All the work is done in this bean's onMessage.</li>
+			<li>onMessage is called by the container when a message arrives at the destination.</li>
+		</ul>
+		</li>
+	</ul>
+	</li>
+</ul>
+
+
+<p>The MDB sample application also provides a Web Application client <b>messaging-ejb.war</b>. This application client allows you to create (create.jsp) and list (list.jsp) customers.</p>
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-MDBMigration-Toolsused"></a>Tools used</h2>
+<p>The tools used for developing and building all the applications are:</p>
+
+<h3><a name="JBosstoGeronimo-EJB-MDBMigration-EclipsewithJBossIDE"></a>Eclipse with JBoss IDE</h3>
+<p>The Eclipse with JBoss IDE plug-ins was used for development of Java-source code of the sample applications. Eclipse is a very powerful and popular open source development tool. Eclipse can be downloaded from the following URL:</p>
+
+<p><a href="http://www.eclipse.org" title="Visit page outside Confluence">&#104;ttp://www.eclipse.org</a></p>
+
+<h3><a name="JBosstoGeronimo-EJB-MDBMigration-ApacheMaven"></a>Apache Maven</h3>
+<p>Maven is a software project management and comprehension tool. Based on the concept of a project object model (<a href="http://maven.apache.org/reference/glossary.html#POM" title="Visit page outside Confluence">POM</a>). Maven can manage a project's build, reporting and documentation from a central piece of information.</p>
+
+<p>For this migration example Maven 1.0.2 was used. Maven can be downloaded from the followinf URL:</p>
+
+<p><a href="http://maven.apache.org" title="Visit page outside Confluence">&#104;ttp://maven.apache.org</a></p>
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-MDBMigration-Sampledatabase"></a>Sample database</h2>
+<p>The sample database for the MDB sample application has only one table. This is an in-memory table. The <b>MEMORY</b> storage engine creates tables with contents that are stored in just in memory. These were formerly known as HEAP tables.</p>
+
+<p>The following table describes the fields of the <b>CUSTOMER</b> table.</p>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'>Field</th>
+<th class='confluenceTh'>data type</th>
+</tr>
+<tr>
+<td class='confluenceTd'>id</td>
+<td class='confluenceTd'>INTEGER</td>
+</tr>
+<tr>
+<td class='confluenceTd'>name</td>
+<td class='confluenceTd'>VARCHAR(45)</td>
+</tr>
+<tr>
+<td class='confluenceTd'>birthdate</td>
+<td class='confluenceTd'>DATE</td>
+</tr>
+<tr>
+<td class='confluenceTd'>sss_no</td>
+<td class='confluenceTd'>VARCHAR(25)</td>
+</tr>
+<tr>
+<td class='confluenceTd'>address</td>
+<td class='confluenceTd'>VARCHAR(60)</td>
+</tr>
+<tr>
+<td class='confluenceTd'>annual_salary</td>
+<td class='confluenceTd'>DOUBLE</td>
+</tr>
+<tr>
+<td class='confluenceTd'>loan_amount</td>
+<td class='confluenceTd'>DOUBLE</td>
+</tr>
+</tbody></table>
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-EJB-MDBMigration-TheJBossenvironment"></a>The JBoss environment <a name="JBosstoGeronimo-EJB-MDBMigration-JBoss"></a></h1>
+<p>This section shows you how and where the sample JBoss reference environment was installed so you can map this scenario to your own implementation. Note that for this migration example JBoss v4.0.2 was used.</p>
+
+<p>Detailed instructions for installing, configuring, and managing JBoss are provided in the product documentation. Check the product Web site for the most updated documents.</p>
+
+<p>The following list highlights the general tasks you will need to complete to install and configure the initial environment as the starting point for deploying the sample application.</p>
+
+<ol>
+	<li>Download and install JBoss v4 as explained in the product documentation guides. From now on the installation directory will be referred as <b>&lt;jboss_home&gt;</b></li>
+	<li>Create a copy of the default JBoss v4 application server. Copy recursively <b>&lt;jboss_home&gt;\server\default</b> to <b>&lt;jboss_home&gt;\server\&lt;your_server_name&gt;</b></li>
+	<li>Start the new server by running the <tt>run.sh -c &lt;your_server_name&gt;</tt> command from the <b>&lt;jboss_home&gt;\bin</b> directory.</li>
+	<li>Once the server is started, you can verify that it is running by opening a Web browser and pointing it to this URL: <a href="http://localhost:8080" title="Visit page outside Confluence">&#104;ttp://localhost:8080</a>. You should see the JBoss Welcome window and be able to access the JBoss console.</li>
+	<li>Once the application server is up and running, the next step is to install and configure all the remaining prerequisite software required by the sample application. This step is described in the following section.</li>
+</ol>
+
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-MDBMigration-Installandconfigureprerequisitesoftware"></a>Install and configure prerequisite software</h2>
+<p>In order to build and run the Loan BMP application included in this article, you need to install and configure the build tool and the database that is used by the application. </p>
+
+<h3><a name="JBosstoGeronimo-EJB-MDBMigration-Modifydatabasesettings"></a>Modify database settings</h3>
+<p>This application is using the HSQL database that comes as part of the JBoss bundle. You need to modify the script for creating the database. Edit the <b>localDB.script</b> file located in the following directory:</p>
+
+<p>&lt;jboss_home&gt;\server\&lt;your_server_name&gt;\data\hypersonic</p>
+
+<p>Add at the top of the <b>localDB.script</b> file the content of the following example in order to create the sample HSQL database.</p>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Make sure JBoss is not running at the time of modifying this file.</b></td></tr></table>
+
+<p><tt>CREATE MEMORY TABLE CUSTOMER(ID INTEGER NOT NULL PRIMARY KEY,NAME VARCHAR(45),BIRTHDATE DATE,SSS_NO VARCHAR(25),ADDRESS VARCHAR(60),ANNUAL_SALARY DOUBLE,LOAN_AMOUNT DOUBLE)</tt></p>
+
+<h3><a name="JBosstoGeronimo-EJB-MDBMigration-ConfigureMaven"></a>Configure Maven</h3>
+<p>As mentioned before, Apache Maven is used to build the binaries for the Loan BMP application. If you do not have Maven installed this is a good time for doing it.</p>
+
+<p>Apache Maven can be downloaded from the following URL:</p>
+
+<p><a href="http://maven.apache.org" title="Visit page outside Confluence">&#104;ttp://maven.apache.org</a></p>
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-MDBMigration-Buildthesampleapplication"></a>Build the sample application</h2>
+<p>In order to build the MDB application a Maven script has been provided. Download the MDB sample application from the following link:</p>
+
+<p><a href="http://localhost:9090/download/attachments/1570/mdb.zip?version=1" title="mdb.zip attached to JBoss to Geronimo - EJB-MDB Migration">MDB Sample Application</a></p>
+
+<p>After extracting the zip file, a <b>mdb</b> directory will be created. From now on, this directory will be referred as &lt;mdb_home&gt;. In that directory open the <b>project.properties</b> file.  Edit the maven.jboss.home property to match your environment.</p>
+
+<div class="preformatted" style="border-style: solid; "><div class="preformattedHeader" style="border-bottom-style: solid; "><b>build.properties</b></div><div class="preformattedContent">
+<pre>maven.multiproject.type=ejb
+maven.ejb.src=dd
+
+maven.jboss.home=&lt;jboss_home&gt;</pre>
+</div></div>
+
+<p>From a command prompt or shell go to the &lt;bmp_home&gt; directory and run the following command:</p>
+
+<p><tt>maven</tt></p>
+
+<p>This will build the jar file and put it in the &lt;bmp_home&gt;/target folder. The jar created by the Maven build contains a JBoss specific deployment descriptor, the <b>jboss.xml</b> file in located the META-INF directory of the JAR is shown in the following example:</p>
+
+<div class="code" style="border-style: solid; "><div class="codeHeader" style="border-bottom-style: solid; "><b>JBoss deployment descriptor - jboss.xml</b></div><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;?xml version='1.0' encoding='UTF-8' ?&gt;</span>
+<span class="code-tag">&lt;jboss&gt;</span>
+	<span class="code-tag">&lt;enterprise-beans&gt;</span>
+		<span class="code-tag">&lt;entity&gt;</span>
+			<span class="code-tag">&lt;ejb-name&gt;</span>CustomerEJB<span class="code-tag">&lt;/ejb-name&gt;</span>
+			<span class="code-tag">&lt;jndi-name&gt;</span>CustomerHomeRemote<span class="code-tag">&lt;/jndi-name&gt;</span>
+			<span class="code-tag">&lt;resource-ref&gt;</span>
+				<span class="code-tag">&lt;res-ref-name&gt;</span>jdbc/ibm-demo<span class="code-tag">&lt;/res-ref-name&gt;</span>
+				<span class="code-tag">&lt;jndi-name&gt;</span>java:/DefaultDS<span class="code-tag">&lt;/jndi-name&gt;</span>
+			<span class="code-tag">&lt;/resource-ref&gt;</span>
+		<span class="code-tag">&lt;/entity&gt;</span>
+		<span class="code-tag">&lt;message-driven&gt;</span>
+			<span class="code-tag">&lt;ejb-name&gt;</span>SampleMDB<span class="code-tag">&lt;/ejb-name&gt;</span>
+			<span class="code-tag">&lt;destination-jndi-name&gt;</span>queue/testQueue<span class="code-tag">&lt;/destination-jndi-name&gt;</span>
+			<span class="code-tag">&lt;ejb-ref&gt;</span>
+				<span class="code-tag">&lt;ejb-ref-name&gt;</span>CustomerHomeRemote<span class="code-tag">&lt;/ejb-ref-name&gt;</span>
+				<span class="code-tag">&lt;jndi-name&gt;</span>CustomerHomeRemote<span class="code-tag">&lt;/jndi-name&gt;</span>
+			<span class="code-tag">&lt;/ejb-ref&gt;</span>
+		<span class="code-tag">&lt;/message-driven&gt;</span>
+	<span class="code-tag">&lt;/enterprise-beans&gt;</span>
+<span class="code-tag">&lt;/jboss&gt;</span></pre>
+</div></div>
+
+<p>The resource-ref element is used to map the resource referred to by the name <b>jdbc/ibm-demo</b> in the ejb-jar.xml file to the resource with the JNDI name <b>java:/DefaultDS</b> and also the <b>CustomerHomeRemote</b> name in ejb-jar.xml to the JNDI name CustomerHomeRemote (The Customer EJB).</p>
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-MDBMigration-Deploythesampleapplication"></a>Deploy the sample application</h2>
+<p>To deploy the Loan BMP application in JBoss, copy the <b>messaging-ejb-SNAPSHOT.jar</b> and <b>messaging-ejb.war</b> files from the &lt;mdb_home&gt;/target directory to the following directory:</p>
+
+<p>&lt;jboss_home&gt;\server\&lt;your_server_name&gt;\deploy</p>
+
+<p>If JBoss is already started, it will automatically deploy and start the applications; otherwise, the applications will be deployed and started at the next startup.</p>
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-MDBMigration-Testthesampleapplication"></a>Test the sample application</h2>
+<p>To test this sample application you can use the command line client or a Web Application client also provided with the sample application download.</p>
+
+<h3><a name="JBosstoGeronimo-EJB-MDBMigration-Testtheapplicationwiththecommandlineclient"></a>Test the application with the command line client</h3>
+<p>To test the sample client application type the following command from the &lt;mdb_home&gt;/target/classes directory:</p>
+
+<p><tt>java -cp ".;&lt;jboss_home&gt;\client\jbossall-client.jar" com.ibm.demo.mdb.client.MessageSenderJBoss</tt></p>
+
+<p>The user will then be prompted for information to populate the message as in the following example:</p>
+
+<p><font color="white"><div class="preformatted" style="border-style: solid; "><div class="preformattedContent" style="background-color: #000000; ">
+<pre>E:\mdb\target\classes&gt;java -cp ".;e:\jboss-4.0.2\client\jbossall-client.jar"  com.ibm.demo.mdb.client.MessageSenderJBoss
+Enter information for new customer.
+Enter customer id (Integer):10
+Enter name:Hernan Cunico
+Enter sss number:123456
+Enter address:101 My Home
+Enter birhtdate (mm/dd/yyyy):10/10/1980
+Enter annual salary:1000000
+Enter loan amount:10000</pre>
+</div></div></font></p>
+
+<p>Enter the appropriate information the press enter. When you have filled up all of the fields the message will be sent.</p>
+
+<p>Look in the JBoss console for the <b>INFO: SUCCESS!!!</b> message, this is the indication that the message was sent successfully.</p>
+
+<p><font color="white"><div class="preformatted" style="border-style: solid; "><div class="preformattedContent" style="background-color: #000000; ">
+<pre>20:21:39,637 INFO  [STDOUT] Oct 26, 2005 8:21:39 PM com.ibm.demo.mdb.ejb.SampleMDB onMessage
+INFO: Received TextMessage: add customer
+20:21:39,647 INFO  [STDOUT] XAConnectionFactory: org.jboss.mq.SpyXAConnectionFactory
+20:21:39,647 INFO  [STDOUT] UIL2ConnectionFactory: javax.naming.LinkRef
+20:21:39,647 INFO  [STDOUT] UserTransactionSessionFactory: $Proxy11
+20:21:39,647 INFO  [STDOUT] HTTPConnectionFactory: org.jboss.mq.SpyConnectionFactory
+20:21:39,647 INFO  [STDOUT] console: org.jnp.interfaces.NamingContext
+20:21:39,647 INFO  [STDOUT] UIL2XAConnectionFactory: javax.naming.LinkRef
+20:21:39,647 INFO  [STDOUT] UUIDKeyGeneratorFactory: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory
+20:21:39,647 INFO  [STDOUT] HTTPXAConnectionFactory: org.jboss.mq.SpyXAConnectionFactory
+20:21:39,647 INFO  [STDOUT] topic: org.jnp.interfaces.NamingContext
+20:21:39,647 INFO  [STDOUT] CustomerHomeRemote: $Proxy52
+20:21:39,647 INFO  [STDOUT] queue: org.jnp.interfaces.NamingContext
+20:21:39,647 INFO  [STDOUT] ConnectionFactory: org.jboss.mq.SpyConnectionFactory
+20:21:39,647 INFO  [STDOUT] UserTransaction: org.jboss.tm.usertx.client.ClientUserTransaction
+20:21:39,647 INFO  [STDOUT] jmx: org.jnp.interfaces.NamingContext
+20:21:39,647 INFO  [STDOUT] HiLoKeyGeneratorFactory: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory
+20:21:39,647 INFO  [STDOUT] UILXAConnectionFactory: javax.naming.LinkRef
+20:21:39,647 INFO  [STDOUT] UILConnectionFactory: javax.naming.LinkRef
+20:21:39,707 INFO  [STDOUT] Oct 26, 2005 8:21:39 PM com.ibm.demo.mdb.ejb.SampleMDB onMessage
+INFO: SUCCESS!!!</pre>
+</div></div></font></p>
+
+<h3><a name="JBosstoGeronimo-EJB-MDBMigration-TesttheapplicationwiththeWebApplicationclient"></a>Test the application with the Web Application client</h3>
+<p>To test the Web application client open a Web browser and access the following URL:</p>
+
+<p><a href="http://localhost:8080/messaging-ejb" title="Visit page outside Confluence">&#104;ttp://localhost:8080/messaging-ejb</a></p>
+
+<p>If you tested via the command line before you should be able to see the entries you just entered.</p>
+
+<p><img src="JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_JB_test.jpg" align="absmiddle" border="0" /></p>
+
+<p>From this Web Application client you can also enter new customers. Click on <b>Add Customer</b> to call the create.jsp, the following page will prompt you to enter the new customer info.</p>
+
+<p><img src="JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_JB_test3.jpg" align="absmiddle" border="0" /></p>
+
+<p>Enter the new customer information then click <b>Create</b>. This will take you back to the first page and show you the updated list of customers.</p>
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-EJB-MDBMigration-TheGeronimoenvironment"></a>The Geronimo environment <a name="JBosstoGeronimo-EJB-MDBMigration-Geronimo"></a></h1>
+<p>Download and install Geronimo from the following URL:</p>
+
+<p><a href="http://geronimo.apache.org/downloads.html" title="Visit page outside Confluence">&#104;ttp://geronimo.apache.org/downloads.html</a></p>
+
+<p>The release notes available there provide clear instructions on system requirements and how to install and start Geronimo.  Throughout the rest of this article we will refer to the Geronimo installation directory as <b>&lt;geronimo_home&gt;</b>.</p>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='warningMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">TCP/IP ports conflict</b><br />If you are planning to run JBoss and Geronimo on the same machine consider to change the default service ports on, at least, one of these servers.</td></tr></table>
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-MDBMigration-Configureresources"></a>Configure resources</h2>
+<p>For this scenario the MDB application will use directly the SystemDatabase from Geronimo. In this case there is no need to set up a new connector for the SystemDatabase since it is already configured as the DefaultDatasource.</p>
+
+<h3><a name="JBosstoGeronimo-EJB-MDBMigration-StarttheGeronimoserver"></a>Start the Geronimo server</h3>
+<p>Ensure that Geronimo is up and running. If the server has not been started yet, do so by typing the following command:</p>
+
+<p><tt>&lt;geronimo_home&gt;/bin/startup.sh</tt></p>
+
+<p>Once the server is started you should see a screen similar as the one illustrated in the following example:</p>
+
+<p><font color="white"><div class="preformatted" style="border-style: solid; "><div class="preformattedContent" style="background-color: #000000; ">
+<pre>E:\geronimo\bin&gt;startup
+Booting Geronimo Kernel (in Java 1.4.2_09)...
+Starting Geronimo Application Server
+[*************] 100%  32s Startup complete
+  Listening on Ports:
+    1099 0.0.0.0 RMI Naming
+    1527 0.0.0.0 Derby Connector
+    4201 0.0.0.0 ActiveIO Connector EJB
+    4242 0.0.0.0 Remote Login Listener
+    8019 0.0.0.0 Tomcat Connector AJP
+    8080 0.0.0.0 Jetty Connector HTTP
+    8090 0.0.0.0 Tomcat Connector HTTP
+    8443 0.0.0.0 Jetty Connector HTTPS
+    8453 0.0.0.0 Tomcat Connector HTTPS
+   61616 0.0.0.0 ActiveMQ Message Broker Connector
+  Started Application Modules:
+    EAR: org/apache/geronimo/Console
+    WAR: org/apache/geronimo/applications/Welcome
+  Web Applications:
+    http://hcunico:8080/
+    http://hcunico:8080/console
+    http://hcunico:8080/console-standard
+Geronimo Application Server started</pre>
+</div></div></font></p>
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+<h3><a name="JBosstoGeronimo-EJB-MDBMigration-ConfiguredatabaseviaGeronimoConsole"></a>Configure database via Geronimo Console</h3>
+<p>Access the Geronimo Console by pointing your Web browser to the following URL:</p>
+
+<p><a href="http://localhost:8080/console" title="Visit page outside Confluence">&#104;ttp://localhost:8080/console</a></p>
+
+<p>Enter <b>system</b> as the username and <b>manager</b> as the password, click <b>Login</b>.</p>
+
+<p>Once logged in, on the bottom left corner from the left navigation panel click on <b>DB Manager</b>. In the text area labeled <b>SQL Command/s</b> enter the following SQL statement and click <b>Run SQL</b>; this will create the table used by the Entity Bean.</p>
+
+<p><tt>CREATE TABLE CUSTOMER(ID INTEGER NOT NULL PRIMARY KEY,NAME VARCHAR(45),BIRTHDATE DATE,SSS_NO VARCHAR(25),ADDRESS VARCHAR(60),ANNUAL_SALARY DOUBLE,LOAN_AMOUNT DOUBLE)</tt></p>
+
+<p><img src="JBoss to Geronimo - EJB-MDB Migration_attachments/BMP-console-DB.jpg" align="absmiddle" border="0" /></p>
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-EJB-MDBMigration-Stepbystepmigration"></a>Step-by-step migration <a name="JBosstoGeronimo-EJB-MDBMigration-migration"></a></h1>
+<p>In this migration example application, the same jar file you deployed in JBoss can also be deployed in Geronimo. This is because the build step packaged both the JBoss <b>jboss.xml</b> and  Geronimo <b>openejb-jar.xml</b> specific deployment plans in the jar file. </p>
+
+<p>You can see both of these files in the <b>META-INF</b> folder of the jar file or in the &lt;mdb_home&gt;/dd/META-INF directory. The openejb-jar.xml should look like the following example:</p>
+
+<div class="code" style="border-style: solid; "><div class="codeHeader" style="border-bottom-style: solid; "><b>Geronimo specific deployment descriptor openejb-jar.xml</b></div><div class="codeContent">
+<pre class="code-xml">&lt;openejb-jar
+    xmlns=<span class="code-quote">"http://www.openejb.org/xml/ns/openejb-jar"</span>
+    <span class="code-keyword">xmlns:naming</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/naming"</span>
+    <span class="code-keyword">xmlns:security</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/security"</span>
+    <span class="code-keyword">xmlns:sys</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment"</span>
+    configId=<span class="code-quote">"MDBDemo"</span> parentId=<span class="code-quote">"org/apache/geronimo/SystemJMS"</span>&gt;
+ <span class="code-tag">&lt;enterprise-beans&gt;</span>
+ 	<span class="code-tag">&lt;message-driven&gt;</span>
+        <span class="code-tag">&lt;ejb-name&gt;</span>SampleMDB<span class="code-tag">&lt;/ejb-name&gt;</span>
+        <span class="code-tag">&lt;resource-adapter&gt;</span>
+        	<span class="code-tag">&lt;target-name&gt;</span>geronimo.server:J2EEApplication=null,J2EEServer=geronimo,
+                             JCAResource=org/apache/geronimo/SystemJMS,j2eeType=JCAResourceAdapter,
+                             name=ActiveMQ RA<span class="code-tag">&lt;/target-name&gt;</span>
+        <span class="code-tag">&lt;/resource-adapter&gt;</span>        
+        <span class="code-tag">&lt;activation-config&gt;</span>
+        	<span class="code-tag">&lt;activation-config-property&gt;</span>
+        		<span class="code-tag">&lt;activation-config-property-name&gt;</span>destination<span class="code-tag">&lt;/activation-config-property-name&gt;</span>
+        		<span class="code-tag">&lt;activation-config-property-value&gt;</span>SendReceiveQueue<span class="code-tag">&lt;/activation-config-property-value&gt;</span>        		
+        	<span class="code-tag">&lt;/activation-config-property&gt;</span>
+        	<span class="code-tag">&lt;activation-config-property&gt;</span>
+        		<span class="code-tag">&lt;activation-config-property-name&gt;</span>destinationType<span class="code-tag">&lt;/activation-config-property-name&gt;</span>
+        		<span class="code-tag">&lt;activation-config-property-value&gt;</span>javax.jms.Queue<span class="code-tag">&lt;/activation-config-property-value&gt;</span>        		
+        	<span class="code-tag">&lt;/activation-config-property&gt;</span>
+        <span class="code-tag">&lt;/activation-config&gt;</span>
+        <span class="code-tag">&lt;ejb-ref&gt;</span>
+            <span class="code-tag">&lt;ref-name&gt;</span>CustomerHomeRemote<span class="code-tag">&lt;/ref-name&gt;</span>
+            <span class="code-tag">&lt;ejb-link&gt;</span>CustomerEJB<span class="code-tag">&lt;/ejb-link&gt;</span>
+        <span class="code-tag">&lt;/ejb-ref&gt;</span>        
+   <span class="code-tag">&lt;/message-driven&gt;</span>
+ 	
+ 	<span class="code-tag">&lt;entity&gt;</span>
+        <span class="code-tag">&lt;ejb-name&gt;</span>CustomerEJB<span class="code-tag">&lt;/ejb-name&gt;</span>
+        <span class="code-tag">&lt;jndi-name&gt;</span>CustomerHomeRemote<span class="code-tag">&lt;/jndi-name&gt;</span>
+        <span class="code-tag">&lt;local-jndi-name&gt;</span><span class="code-tag">&lt;/local-jndi-name&gt;</span>
+        <span class="code-tag">&lt;resource-ref&gt;</span>
+            <span class="code-tag">&lt;ref-name&gt;</span>jdbc/ibm-demo<span class="code-tag">&lt;/ref-name&gt;</span>
+            <span class="code-tag">&lt;resource-link&gt;</span>SystemDatasource<span class="code-tag">&lt;/resource-link&gt;</span>
+        <span class="code-tag">&lt;/resource-ref&gt;</span>
+    <span class="code-tag">&lt;/entity&gt;</span>
+    
+ <span class="code-tag">&lt;/enterprise-beans&gt;</span>
+    
+<span class="code-tag">&lt;/openejb-jar&gt;</span></pre>
+</div></div>
+
+<p>As shown in the example, the parent for this configuration is the org/apache/geronimo/SystemJMS connector.  Then follows the definition of the EJBs. </p>
+
+<p>The message-driver element defines the message driven bean. The child element resource-adapter/target-name specifies the Gbean name of the resource adapter that will be used to connect to JMS. The activation-config element and its children define the Queue that the MDB will listen to. Here it is used the SendReceiveQueue that is deployed in Geronimo by default. The ejb-ref element and its children define the EJBs that the MDB will access. </p>
+
+<p>The entity element defines an entity bean. The resource ref element defines the datasource that this EJB will be using.</p>
+
+<p>The Web Application client can also be direclty deployed in Geronimo. This is because the build step packages both the JBoss <b>jboss-web.xml</b> and  Geronimo <b>geronimo-web.xml</b> specific deployment plans in the war file. You can see both of these files in the &lt;mdb_home&gt;\src\webapp\WEB-INF directory.</p>
+
+<p>The <b>geronimo-web.xml</b> deployment plan should look like the following example.</p>
+
+<div class="code" style="border-style: solid; "><div class="codeHeader" style="border-bottom-style: solid; "><b>Geronimo deployment plan geronimo-web.xml</b></div><div class="codeContent">
+<pre class="code-xml">&lt;web-app xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/web"</span>
+         <span class="code-keyword">xmlns:naming</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/naming"</span>
+         configId=<span class="code-quote">"MDBDemoWebApp"</span>
+         parentId=<span class="code-quote">"MDBDemo"</span>&gt;
+         
+     <span class="code-tag">&lt;context-root&gt;</span>messaging-ejb<span class="code-tag">&lt;/context-root&gt;</span>    
+     
+     <span class="code-tag">&lt;ejb-ref&gt;</span>
+        <span class="code-tag">&lt;ref-name&gt;</span>ejb/CustomerHome<span class="code-tag">&lt;/ref-name&gt;</span>
+        <span class="code-tag">&lt;target-name&gt;</span>
+             geronimo.server:EJBModule=MDBDemo,J2EEApplication=null,
+             J2EEServer=geronimo,j2eeType=EntityBean,name=CustomerEJB
+        <span class="code-tag">&lt;/target-name&gt;</span>
+     <span class="code-tag">&lt;/ejb-ref&gt;</span>
+
+     <span class="code-tag">&lt;resource-ref&gt;</span>
+        <span class="code-tag">&lt;ref-name&gt;</span>jms/broker<span class="code-tag">&lt;/ref-name&gt;</span>
+        <span class="code-tag">&lt;resource-link&gt;</span>DefaultActiveMQConnectionFactory<span class="code-tag">&lt;/resource-link&gt;</span>
+     <span class="code-tag">&lt;/resource-ref&gt;</span>
+    
+     <span class="code-tag">&lt;resource-env-ref&gt;</span>
+        <span class="code-tag">&lt;ref-name&gt;</span>jms/queue/DefQueue<span class="code-tag">&lt;/ref-name&gt;</span>
+        <span class="code-tag">&lt;message-destination-link&gt;</span>SendReceiveQueue<span class="code-tag">&lt;/message-destination-link&gt;</span>
+     <span class="code-tag">&lt;/resource-env-ref&gt;</span>
+<span class="code-tag">&lt;/web-app&gt;</span></pre>
+</div></div>
+
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-EJB-MDBMigration-Deploythemigratedsampleapplication"></a>Deploy the migrated sample application</h2>
+<p>Ensure that Geronimo server is up and running. From a command line change directory to &lt;geronimo_home&gt;/bin and type the following command:</p>
+
+<p><tt>java -jar deployer.jar --user system --password manager deploy &lt;mdb_home&gt;/target/messaging-ejb-SNAPSHOT.jar</tt></p>
+
+<p>To deploy the sample Web Application client type the following command:</p>
+
+<p><tt>java -jar deployer.jar --user system --password manager deploy &lt;mdb_home&gt;/target/messaging-ejb.war</tt></p>
+
+<p>Once the application is deployed, you can test it by running the application client from a command line or using the sample Web Application client just like you tested the application in JBoss.</p>
+
+<h3><a name="JBosstoGeronimo-EJB-MDBMigration-Testtheapplicationfromthecommandlineclient"></a>Test the application from the command line client</h3>
+<p>From a command line change directory to the &lt;mdb_home&gt;/target/classes directory and type the following command:</p>
+
+<p><tt>java -cp ".;&lt;geronimo_home&gt;/repository/activemq/jars/activemq-core-3.2-M1.jar;&lt;geronimo_home&gt;/repository/geronimo-spec/jars/geronimo-spec-j2ee-1.4-rc4.jar;&lt;geronimo_home&gt;/lib/commons-logging-1.0.4.jar;&lt;geronimo_home&gt;/repository/concurrent/jars/concurrent-1.3.4.jar" com.ibm.demo.mdb.client.MessageSenderAMQ</tt></p>
+
+<p>You will then be prompted for information to populate the message as in the following example. Enter the appropriate information the press <b>Enter</b>. When you have filled up all of the fields the message will be sent.</p>
+
+<p><font color="white"><div class="preformatted" style="border-style: solid; "><div class="preformattedContent" style="background-color: #000000; ">
+<pre>...
+Oct 27, 2005 5:12:29 PM org.activemq.ActiveMQConnection statusChanged
+INFO: channel status changed: Channel: TcpTransportChannel: Socket[addr=localhost/127.0.0.1,port=61616,localport=1176] has connected
+Enter information for new customer.
+Enter customer id (Integer):10
+Enter name:Hernan Cunico
+Enter sss number:123456789
+Enter address:101 My Home
+Enter birhtdate (mm/dd/yyyy):11/11/1999
+Enter annual salary:1000000
+Enter loan amount:10000
+Message sent.</pre>
+</div></div></font></p>
+
+<p>To verify that the data has been added to the database, from the DB Manager page on the Geronimo Consloe click on the <b>Application</b> link under <b>View Tables</b> section for the <b>SystemDatabase</b> . On the following page, click on <b>View Contents</b> for the Customer table. You should see something like the following figure.</p>
+
+<p><img src="JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_G_test.jpg" align="absmiddle" border="0" /></p>
+
+<p>Additionally, in the command line window/shell where you started Geronimo you should be able to see the confirmation that the message was sent.</p>
+
+<p><font color="white"><div class="preformatted" style="border-style: solid; "><div class="preformattedContent" style="background-color: #000000; ">
+<pre>...
+Oct 27, 2005 5:13:03 PM com.ibm.demo.mdb.ejb.SampleMDB onMessage
+INFO: Received TextMessage: add customer
+JMXConnector: java.lang.Object
+Oct 27, 2005 5:13:03 PM com.ibm.demo.mdb.ejb.SampleMDB onMessage
+INFO: SUCCESS!!!</pre>
+</div></div></font></p>
+
+<h3><a name="JBosstoGeronimo-EJB-MDBMigration-TesttheapplicationwiththeWebApplicationclient"></a>Test the application with the Web Application client</h3>
+<p>Open a Web browser and poit it to the following URL:</p>
+
+<p><a href="http://hcunico:8080/messaging-ejb" title="Visit page outside Confluence">&#104;ttp://hcunico:8080/messaging-ejb</a></p>
+
+<p>Repeat the same steps you did when testing on JBoss.</p>
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-EJB-MDBMigration-Summary"></a>Summary <a name="JBosstoGeronimo-EJB-MDBMigration-summary"></a></h1>
+<p>The sample application used for this migration exercise, while simple, provides you with detailed instructions on how to migrate an application that uses MDB from JBoss V4.0.2 to Apache Geronimo. The modifications to make this happen were restricted to the xml configuration files with no java code changes necessary.</p>
+
+<p><a href="#JBosstoGeronimo-EJB-MDBMigration-top" title="top on JBoss to Geronimo - EJB-MDB Migration">Back to Top</a></p>
+
+				    					    <br/>
+                        <div class="tabletitle">
+                            <a name="attachments">Attachments:</a>
+                        </div>
+
+                        <div class="greybox" align="left">
+                                                            <img src="icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="JBoss to Geronimo - EJB-MDB Migration_attachments/BMP-console-DB.jpg">BMP-console-DB.jpg</a> (image/pjpeg)
+                                <br/>
+                                                            <img src="icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="JBoss to Geronimo - EJB-MDB Migration_attachments/mdb.zip">mdb.zip</a> (application/x-zip-compressed)
+                                <br/>
+                                                            <img src="icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_flow.jpg">MDB_flow.jpg</a> (image/pjpeg)
+                                <br/>
+                                                            <img src="icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_G_test.jpg">MDB_G_test.jpg</a> (image/pjpeg)
+                                <br/>
+                                                            <img src="icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_JB_test3.jpg">MDB_JB_test3.jpg</a> (image/pjpeg)
+                                <br/>
+                                                            <img src="icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_JB_test.jpg">MDB_JB_test.jpg</a> (image/pjpeg)
+                                <br/>
+                                                    </div>
+				    
+                    			    </td>
+		    </tr>
+	    </table>
+	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
+			<tr>
+				<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
+			</tr>
+		    <tr>
+			    <td align="center"><font color="grey">Document generated by Confluence on Dec 15, 2005 19:14</font></td>
+		    </tr>
+	    </table>
+    </body>
+</html>
\ No newline at end of file

Added: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-MDB Migration_attachments/BMP-console-DB.jpg
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20EJB-MDB%20Migration_attachments/BMP-console-DB.jpg?rev=357449&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-MDB Migration_attachments/BMP-console-DB.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_G_test.jpg
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20EJB-MDB%20Migration_attachments/MDB_G_test.jpg?rev=357449&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_G_test.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_JB_test.jpg
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20EJB-MDB%20Migration_attachments/MDB_JB_test.jpg?rev=357449&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_JB_test.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_JB_test3.jpg
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20EJB-MDB%20Migration_attachments/MDB_JB_test3.jpg?rev=357449&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_JB_test3.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_flow.jpg
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20EJB-MDB%20Migration_attachments/MDB_flow.jpg?rev=357449&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-MDB Migration_attachments/MDB_flow.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-MDB Migration_attachments/mdb.zip
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20EJB-MDB%20Migration_attachments/mdb.zip?rev=357449&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - EJB-MDB Migration_attachments/mdb.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message