geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hogst...@apache.org
Subject svn commit: r357449 [8/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 - JDBC Migration.html
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20JDBC%20Migration.html?rev=357449&view=auto
==============================================================================
--- geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - JDBC Migration.html (added)
+++ geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - JDBC Migration.html Sat Dec 17 22:04:20 2005
@@ -0,0 +1,691 @@
+<html>
+    <head>
+        <title>Documentation : JBoss to Geronimo - JDBC 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 - JDBC 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-JDBCMigration-top"></a><br/>
+<em><b>Article donated by:</b> <a href="mailto:manugeorge@gmail.com" title="Send mail to Manu T George">Manu T George</a>, <a href="mailto:hcunico@gmail.com" title="Send mail to Hernan Cunico">Hernan Cunico</a></em></p>
+
+<h1><a name="JBosstoGeronimo-JDBCMigration-Overview"></a>Overview</h1>
+<p>This article will help you migrate JDBC applications developed for JBoss v4 to Apache Geronimo. This article is part of a series of migration articles covering different types of applications migration.</p>
+
+<p>This article provides details on the JDBC implementation differences between these two application servers as well as a detailed step-by-step migration procedure for porting JDBC applications from JBoss v4 to Apache Geronimo.  To define a common starting point (the source environment), this article provides steps for deploying the <a href="http://localhost:9090/download/attachments/1565/brokerage.zip?version=1" title="brokerage.zip attached to JBoss to Geronimo - JDBC Migration">Online Brokerage</a> sample application into the JBoss source environment. Then you will be guided through the application migration and deployment process in Apache Geronimo.</p>
+
+<p>This article is organized in the following sections:</p>
+
+<ul>
+	<li><a href="#JBosstoGeronimo-JDBCMigration-implementation" title="implementation on JBoss to Geronimo - JDBC Migration">JDBC implementation analysis</a></li>
+	<li><a href="#JBosstoGeronimo-JDBCMigration-sampleApp" title="sampleApp on JBoss to Geronimo - JDBC Migration">Sample application</a></li>
+	<li><a href="#JBosstoGeronimo-JDBCMigration-JBoss" title="JBoss on JBoss to Geronimo - JDBC Migration">The JBoss environment</a></li>
+	<li><a href="#JBosstoGeronimo-JDBCMigration-Geronimo" title="Geronimo on JBoss to Geronimo - JDBC Migration">The Geronimo environment</a></li>
+	<li><a href="#JBosstoGeronimo-JDBCMigration-migration" title="migration on JBoss to Geronimo - JDBC Migration">Step-by-step migration</a></li>
+	<li><a href="#JBosstoGeronimo-JDBCMigration-summary" title="summary on JBoss to Geronimo - JDBC Migration">Summary</a></li>
+</ul>
+
+
+<h1><a name="JBosstoGeronimo-JDBCMigration-JDBCimplementationanalysis"></a>JDBC implementation analysis <a name="JBosstoGeronimo-JDBCMigration-implementation"></a></h1>
+<p>JDBC implementation may vary from one vendor to another. The purpose of this section is to provide a JDBC specific feature-to-feature comparison between JBoss and Apache Geronimo so you can clearly identify the differences and plan accordingly before migration.</p>
+
+<p>Given that JBoss and Geronimo both use J2CA connectors for accessing JDBC resources, there will be an overlap of some J2CA features when comparing the platform specific JDBC features. </p>
+
+<p><b>Note:</b> Since Geronimo is still in its infancy some of the features provided by JBoss may not yet be implemented in Geronimo.</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'>JDBC access</td>
+<td class='confluenceTd'>JDBC access in JBoss is through JDBC connectors based on the JCA specification.</td>
+<td class='confluenceTd'>Geronimo does not have any direct integration with JDBC but supports access through the generic J2CA framework. The TranQL project has J2CA adapters for various databases.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>JCA implementation</td>
+<td class='confluenceTd'>JBoss AS 4.0 implements the JCA (Java Connector Architecture) 1.5 specification instead of the JCA 1.0 in JBoss AS 3.2.</td>
+<td class='confluenceTd'>Geronimo supports the JCA 1.5 specification and is backward compatible to the JCA 1.0 specification.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>Data sources supported</td>
+<td class='confluenceTd'>Supports 5 types of data sources:
+<ul class="alternate" type="square">
+	<li>no-tx-datasource</li>
+	<li>local-tx-datasource</li>
+	<li>xa-datasource</li>
+	<li>ha-local-tx-datasource</li>
+	<li>ha-xa-datasource</li>
+</ul>
+</td>
+<td class='confluenceTd'>TranQL has generic wrappers for data source, ConnectionPoolDatasource, and XADataSource.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>Data source failover</td>
+<td class='confluenceTd'>JBoss has data source failover capabilities implemented through two data sources.<br/>
+1)	ha-local-tx-datasource - for local transactions.<br/>
+2)	ha-xa-datasource - for distributed transactions</td>
+<td class='confluenceTd'>TranQL has specialized drivers for certain databases (including Apache Derby, Oracle and soon DB2) that provide a tighter integration with the advanced features of the driver.<br/>
+It is at this level that features such as load-balancing and failover would be provided. You can also use a C-JDBC wrapper for providing database clustering and failover.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>XA support</td>
+<td class='confluenceTd'>Supports XA transactions, Local Transactions, and No transaction.</td>
+<td class='confluenceTd'>Supports XA transactions, Local Transactions, and No transaction.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>Connection Manager Configurability</td>
+<td class='confluenceTd'>You can plug in your own custom connection manager if required.</td>
+<td class='confluenceTd'>The J2CA framework is interceptor based which allows different parts of the connection framework to be plugged in.<br/>
+Although you cannot plug in a custom connection manager now, this capability can be added fairly easily.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>JTA implementation</td>
+<td class='confluenceTd'>Full support for JTA through JBossJTA.</td>
+<td class='confluenceTd'>Transaction support is provided through JOTM and HOWL.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>Connection pooling and management</td>
+<td class='confluenceTd'>JBossCX framework used for connection pooling and management.</td>
+<td class='confluenceTd'>Custom Geronimo Code and TranQL used for connection pooling and management.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>Legacy driver support</td>
+<td class='confluenceTd'>JBoss provides connection to RDBMS that have not yet implemented JCA- JDBC drivers through JCA wrappers for JDBC drivers.</td>
+<td class='confluenceTd'>Geronimo also provides this through the TranQL- connector JDBC to JCA wrapper in Geronimo. Supports JDBC 3.0 and 2.1.</td>
+</tr>
+</tbody></table>
+
+<p><a href="#JBosstoGeronimo-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-JDBCMigration-Sampleapplication"></a>Sample application <a name="JBosstoGeronimo-JDBCMigration-sampleApp"></a></h1>
+<p>This article contains a sample application to demonstrate migrating an application from JBoss to Geronimo, called <a href="http://localhost:9090/download/attachments/1565/brokerage.zip?version=1" title="brokerage.zip attached to JBoss to Geronimo - JDBC Migration">Online Brokerage</a>. It represents an online trading scenario in which users can buy and sell stocks. The application has the following five pages:</p>
+
+<ul>
+	<li>Login Page</li>
+	<li>Registration Page</li>
+	<li>User Information Page</li>
+	<li>Available Stocks Page</li>
+	<li>User Portfolio Page</li>
+</ul>
+
+
+<p>The following figure illustrates the application flow:<br/>
+<img src="JBoss to Geronimo - JDBC Migration_attachments/JSP_flow.jpg" align="absmiddle" border="0" /></p>
+
+<p>First, the user accesses the Login page. From the Login page the user enters the user name and password. If the user name or password is not valid the application throws an error message and rejects the user's login attempt. If the user name and password are correct, the user is taken to the Available Stocks page where he/she can view all the stocks that are present for sale at that time.</p>
+
+<p>The user can choose to buy as many stocks as wanted, depending on the available money in the account, by clicking the Buy button.</p>
+
+<p>After the transaction completes successfully the user is brought back to the Available Stocks page where he/she can buy more stocks if required. </p>
+
+<p>If the user has insufficient funds to buy stocks the application will throw an error and will not process the transaction. The error message is shown at the top of the Available Stocks page.  There is a User Info button on this page. On clicking this button the user is taken to the User Info page and shown the user details. </p>
+
+<p>From the Available Stocks page there is a View your Portfolio link that shows all the stocks that the user owns. In that page, the user can select the stocks and quantity to sell.  This page also shows the user's available cash in the User Cash field. If the user tries to sell more stocks than he has, the application will throw an error. The error message will be shown on the same page. For each successful sale the sale amount is added to the user's cash balance. </p>
+
+<p>The quantity text box shows the quantity of stocks of a particular company that the user has. The Quantity to Sell field allows the user to enter the quantity of stocks to sell for a specific company. For selling and buying the radio button should be checked. This should be done after entering the values. If either the quantity to sell textbox is not filled or the selection box is not checked and you press on sell a JavaScript alert will be triggered saying that the required field is empty. On entering non numeric characters for quantity another alert will be triggered. This behavior is similar for the Available Stocks page as well.</p>
+
+<p>New users can register by clicking the Register button in the login page. In the Registration page the user will enter a user id, user name, password, address and available cash.</p>
+
+<p><a href="#JBosstoGeronimo-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-JDBCMigration-ApplicationclassesandJSPpages"></a>Application classes and JSP pages</h2>
+<p>The Online Brokerage sample application consists of the following packages:</p>
+
+<ul>
+	<li>com.dev.trade.bo
+	<ul>
+		<li>Stock- Represents the stock of a company.</li>
+		<li>User- Represents the user.</li>
+	</ul>
+	</li>
+</ul>
+
+
+<ul>
+	<li>com.dev.trade.dao
+	<ul>
+		<li>TradeDAO - Contains all the database access methods.</li>
+	</ul>
+	</li>
+</ul>
+
+
+<ul>
+	<li>com.dev.trade.exception
+	<ul>
+		<li>DBException - Custom exception class that is thrown for all database exceptions.</li>
+	</ul>
+	</li>
+</ul>
+
+
+<ul>
+	<li>com.dev.trade.servlet
+	<ul>
+		<li>TradeDispatcherServlet - Dispatches all the requests to the JSPs after performing required database functions.</li>
+	</ul>
+	</li>
+</ul>
+
+
+<p>The Online Brokerage also includes the following JSP pages:</p>
+
+<ul>
+	<li>login.jsp - The login page of the application.</li>
+	<li>error.jsp - The default error page of the application.</li>
+	<li>register.jsp - The user registration page.</li>
+	<li>stocks.jsp - The Available Stocks page from where the user can buy stocks.</li>
+	<li>userstocks.jsp - The user portfolio page which shows the user's stocks. The user can sell stocks from this page.</li>
+</ul>
+
+
+<p><a href="#JBosstoGeronimo-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-JDBCMigration-Toolsused"></a>Tools used</h2>
+<p>The tools used for developing and building the Online Brokerage application are:</p>
+
+<h3><a name="JBosstoGeronimo-JDBCMigration-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:<br/>
+<a href="http://www.eclipse.org" title="Visit page outside Confluence">&#104;ttp://www.eclipse.org</a></p>
+
+<h3><a name="JBosstoGeronimo-JDBCMigration-ApacheAnt"></a>Apache Ant</h3>
+<p>Ant is a pure Java build tool. It is used for building the war files and populating the database for the Online Brokerage application. Ant can be downloaded from the following URL:<br/>
+<a href="http://ant.apache.org" title="Visit page outside Confluence">&#104;ttp://ant.apache.org</a></p>
+
+<p><a href="#JBosstoGeronimo-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-JDBCMigration-Sampledatabase"></a>Sample database</h2>
+<p>The database used for demostrating this application is MySQL.  The sample database name is <b>tradedb</b> and it consists of the following three tables, STOCKS, USERS and TRADINGACCOUNT.  The fields for each of these tables are described below.</p>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'>Table Name</th>
+<th class='confluenceTh'> Fields</th>
+</tr>
+<tr>
+<td class='confluenceTd'>STOCKS</td>
+<td class='confluenceTd'>ID (PRIMARY KEY)<br/>
+NAME<br/>
+PRICE</td>
+</tr>
+<tr>
+<td class='confluenceTd'>USERS</td>
+<td class='confluenceTd'>USERID (PRIMARY KEY)<br/>
+NAME<br/>
+PASSWORD<br/>
+ADDRESS<br/>
+CASH</td>
+</tr>
+<tr>
+<td class='confluenceTd'>TRADINGACCOUNT</td>
+<td class='confluenceTd'>USERID<br/>
+STOCKID<br/>
+QUANTITY</td>
+</tr>
+</tbody></table>
+
+<p>The TRADINGACCOUNT table is used to store the stocks that are owned by each user. The USERS and STOCKS tables are used to store the user and stock details. Because this is just a sample application the amount of money that a user has is entered during user registration by the user itself.  </p>
+
+<p>The DDL file used for populating this database is db.sql and it is located in the brokerage/sql directory.</p>
+
+<p><a href="#JBosstoGeronimo-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-JDBCMigration-TheJBossenvironment"></a>The JBoss environment <a name="JBosstoGeronimo-JDBCMigration-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.</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-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-JDBCMigration-Installandconfigureprerequisitesoftware"></a>Install and configure prerequisite software</h2>
+<p>In order to build and run the Online Brokerage 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-JDBCMigration-Installthedatabase"></a>Install the database</h3>
+<p>As mentioned earlier in the article, this application is using the MySQL database that can be downloaded from the following URL:<br/>
+<a href="http://www.mysql.com" title="Visit page outside Confluence">&#104;ttp://www.mysql.com</a><br/>
+The Installation and configuration of MySQL is fairly intuitive and it is well documented in the MySQL Reference Manual available at the following URL:</p>
+
+<p><a href="http://dev.mysql.com/doc/mysql/en" title="Visit page outside Confluence">&#104;ttp://dev.mysql.com/doc/mysql/en</a></p>
+
+<p><b>Note:</b> During the instance configuration I modified the security settings and specified "password" as the password for the root user. This user ID and password will later be used for accessing the database from the sample application.</p>
+
+<h3><a name="JBosstoGeronimo-JDBCMigration-Createsampledatabase"></a>Create sample database</h3>
+<p>Once the MySQL instance is configured you need to create the sample database that will be used by the Online Brokerage application. From a command line, type the following command to start the MySQL monitor:</p>
+
+<p><b><tt>mysql -u root -ppassword</tt></b></p>
+
+<p>Note that there is no blank between the flag -p and the password.  </p>
+
+<p>This will bring up the MySQL command interface as shown in the following example:</p>
+<div class="preformatted" style="border-style: solid; "><div class="preformattedHeader" style="border-bottom-style: solid; "><b>MySQL monitor interface</b></div><div class="preformattedContent">
+<pre>Welcome to the MySQL monitor.  Commands end with ; or \g.
+Your MySQL connection id is 7 to server version: 4.1.14-nt
+
+Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
+
+mysql&gt;</pre>
+</div></div>
+
+<p>From the MySQL command interface create the tradedb sample database by typing the following command:</p>
+
+<p><b><tt>mysql&gt; create database tradedb;</tt></b></p>
+
+<h3><a name="JBosstoGeronimo-JDBCMigration-ConfigureAnt"></a>Configure Ant</h3>
+<p>As mentioned before, Apache Ant is used to build the binaries for the Online Brokerage application. If you do not have Ant installed this is a good time for doing it and make sure that <b>&lt;ant_home&gt;\bin</b> directory is added to the system's path variable.</p>
+
+<p>Apache Ant can be downloaded from the following URL:</p>
+
+<p><a href="http://ant.apache.org" title="Visit page outside Confluence">&#104;ttp://ant.apache.org</a></p>
+
+<p><a href="#JBosstoGeronimo-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-JDBCMigration-Configureresources"></a>Configure resources</h2>
+<p>In order to successfully build and deploy the Online Brokerage application and database, you will first need to configure some resources. This section describes how to configure a MySQL data source in JBoss.</p>
+
+<h3><a name="JBosstoGeronimo-JDBCMigration-Datasource"></a>Data source</h3>
+<p>The Online Brokerage application is a Web application that uses a data source to connect to the MySQL database. To use JBoss with MySQL you need to copy the MySQL driver into the JBoss server classpath. The driver, which is provided by the database vendor, is called Connector/J 3.0 and can be downloaded from the following URL:<br/>
+<a href="http://dev.mysql.com/downloads/connector/j/3.0.html" title="Visit page outside Confluence">&#104;ttp://dev.mysql.com/downloads/connector/j/3.0.html</a></p>
+
+<p>After downloading and extracting the driver, copy the <b>mysql-connector-java-3.1.10-bin.jar</b> file to the <b>&lt;jboss_home&gt;\server\&lt;your_server_name&gt;\lib</b> directory.</p>
+
+<p>The data source configuration in JBoss is done through an XML configuration file. The JBoss installation contains sample configuration files for many popular databases including MySQL.</p>
+
+<p>The sample data source configuration file for MySQL is <b>mysql-ds.xml</b> and it is located in the <b>&lt;jboss_home&gt;\docs\examples\jca</b> directory:</p>
+
+<p>Copy the mysql-ds.xml file to the deploy directory of your JBoss server (<tt>&lt;jboss_home&gt;\server\&lt;your_server_name&gt;\deploy</tt>) and edit it as shown in the following example:</p>
+
+<div class="code" style="border-style: solid; "><div class="codeHeader" style="border-bottom-style: solid; "><b>Update the mysql-ds.xml file</b></div><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;jndi-name&gt;</span>jdbc/TradeDB<span class="code-tag">&lt;/jndi-name&gt;</span>
+<span class="code-tag">&lt;connection-url&gt;</span>jdbc:mysql://localhost:3306/tradedb<span class="code-tag">&lt;/connection-url&gt;</span>
+<span class="code-tag">&lt;driver-class&gt;</span>com.mysql.jdbc.Driver<span class="code-tag">&lt;/driver-class&gt;</span>
+<span class="code-tag">&lt;user-name&gt;</span>root<span class="code-tag">&lt;/user-name&gt;</span>
+<span class="code-tag">&lt;password&gt;</span>password<span class="code-tag">&lt;/password&gt;</span>
+<span class="code-tag">&lt;exception-sorter-class-name&gt;</span>
+org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
+<span class="code-tag">&lt;/exception-sorter-class-name&gt;</span></pre>
+</div></div>
+
+<p>Delete all the other tags inside the <b>&lt;local-tx-datasource&gt;</b> tag and save the file. JBoss will automatically deploy the data source.       </p>
+
+<p><a href="#JBosstoGeronimo-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-JDBCMigration-Buildthesampleapplication"></a>Build the sample application</h2>
+<p>The Online Brokerage application included with this article provides an Ant script that you will use in order to build the application and populate the database. Download the Online Brokerage application from the following link:</p>
+
+<p>Online Brokerage|^brokerage.zip]</p>
+
+<p>After extracting the zip file, a brokerage directory is created. In that directory open the <b>build.properties</b> file and edit the properties to match your environment as shown in the following example:</p>
+
+<div class="preformatted" style="border-style: solid; "><div class="preformattedHeader" style="border-bottom-style: solid; "><b>Update the build.properties file</b></div><div class="preformattedContent">
+<pre># Replace server.name with either jboss or geronimo depending on which server to deploy.
+server.name=jboss
+#Replace &lt;JAVA_HOME&gt; with your JDK home directory
+java.home=&lt;JAVA_HOME&gt;
+#Replace &lt;JBOSS_HOME&gt; with the root directory for your specific JBoss server &lt;jboss_home&gt;\servers\&lt;server_name&gt;
+jboss.home=&lt;JBOSS_HOME&gt;
+#fully qualified name of the JDBC driver class
+db.driver=com.mysql.jdbc.Driver
+#database URL
+db.url=jdbc:mysql://localhost:3306/tradedb
+#database userId
+db.userid=root
+#database password
+db.password=password
+#script files for creating the tables
+sql.file=sql/db.sql
+#location of the jdbc driver jar.
+driver.classpath=&lt;jboss_home&gt;/server/&lt;your_server_name&gt;/lib/mysql-connector-java-3.1.10-bin.jar</pre>
+</div></div>
+
+<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 specifying the driver.classpath in the build.properties file, make sure to use just the forward slash "/" , otherwise the build will not find the jar file.</td></tr></table>
+
+<p>From a command prompt or shell go to the brokerage directory and run <b>ant</b>. This will build the war file and place it directly in the brokerage directory. The war created by the ant build contains a JBoss specific deployment descriptor, the <b>jboss-web.xml</b> 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</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;context-root&gt;</span>/brokerage<span class="code-tag">&lt;/context-root&gt;</span>
+  <span class="code-tag">&lt;resource-ref&gt;</span>
+      <span class="code-tag">&lt;res-ref-name&gt;</span>jdbc/TradeDB<span class="code-tag">&lt;/res-ref-name&gt;</span>
+      <span class="code-tag">&lt;res-type&gt;</span>javax.sql.DataSource<span class="code-tag">&lt;/res-type&gt;</span>
+      <span class="code-tag">&lt;jndi-name&gt;</span>java:jdbc/TradeDB<span class="code-tag">&lt;/jndi-name&gt;</span>
+  <span class="code-tag">&lt;/resource-ref&gt;</span>
+<span class="code-tag">&lt;/jboss-web&gt;</span></pre>
+</div></div>
+
+
+<p>The resource-ref element is used to map the resource referred to by the name jdbc/TradeDB in the web.xml file to the resource with the JNDI name java:jdbc/TradeDB i.e. the MySQL datasource. </p>
+
+<p><a href="#JBosstoGeronimo-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-JDBCMigration-Deploythesampleapplication"></a>Deploy the sample application</h2>
+<p>To deploy the Online Brokerage application in JBoss, copy the <b>brokerage.war</b> file you just built with Ant to the following directory:</p>
+
+<p><tt>&lt;jboss_home&gt;\server\&lt;your_server_name&gt;\deploy</tt></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-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-JDBCMigration-Testthesampleapplication"></a>Test the sample application</h2>
+<p>To test the application, open a Web browser and access the following URL:</p>
+
+<p><a href="http://localhost:8080/brokerage" title="Visit page outside Confluence">&#104;ttp://localhost:8080/brokerage</a></p>
+
+<p>This brings up the login screen of the Online Brokerage application.  Enter <b>j2ee</b> as the user name and <b>password</b> as the password and click on login. This takes you to the available stocks page illustrated in the following figure. The application is now configured and running.</p>
+
+<p><img src="JBoss to Geronimo - JDBC Migration_attachments/availableStocks.jpg" align="absmiddle" border="0" /></p>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='tipMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Tip</b><br />If you want to use another root password for the database, replace the occurrences of 'password' with the required password. This has to be changed in the following three places:
+<ol>
+	<li>MySQL instance configuration.</li>
+	<li>Data source configuration file.</li>
+	<li>build.properties file used by the Ant build script.</li>
+</ol>
+</td></tr></table>
+
+<p><a href="#JBosstoGeronimo-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-JDBCMigration-TheGeronimoenvironment"></a>The Geronimo environment <a name="JBosstoGeronimo-JDBCMigration-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-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-JDBCMigration-Configureresources"></a>Configure resources</h2>
+<p>In Geronimo the JDBC resources are implemented using J2EE connectors. Therefore, you need to write a Geronimo specific deployment plan for deploying a JDBC datasource. Additionally, while doing the deployment you need to provide the deployer with the <b>tranql-connector-1.0.rar</b> file. This RAR file contains the connection pool management logic for Geronimo. </p>
+
+<p>For running the Online Brokerage application in Geronimo, you will be using the same MySQL database that was used with JBoss. So the only task you need to do in order to prepare the Geronimo environment is to configure the data source.</p>
+
+<h3><a name="JBosstoGeronimo-JDBCMigration-Configurethedatasource"></a>Configure the data source</h3>
+<p>The first thing you need to do is to copy the MySQL database driver into the Geronimo repository so that you can refer to it in the data source deployment plan.</p>
+
+<p>The Geronimo repository is located at &lt;geronimo_home&gt;/repository. Inside this directory, create a directory called <b>mysql/jars</b> and copy the <b>mysql-connector-java-3.1.10-bin.jar</b> file into it. Now, you need to create the data source deployment plan.</p>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='infoMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Different types of data sources</b><br />There are three types of data sources that Geronimo supports:
+<ul>
+	<li>Global data source - Visible to all the applications on a Geronimo Instance.</li>
+	<li>Application scoped data source - Visible to a single application within which it is defined.</li>
+	<li>Module scoped data source - Visible to a single module within which it is defined.</li>
+</ul>
+
+
+<p>For this migration exercise you will be using a Global data source. For instructions on configuring and using the other two types of data sources see the the following developerWorks article:</p>
+
+<p><a href="http://www.ibm.com/developerworks/opensource/library/os-ag-jdbc/" title="Visit page outside Confluence">&#104;ttp://www.ibm.com/developerworks/opensource/library/os-ag-jdbc/</a></p></td></tr></table>
+
+<p><a href="#JBosstoGeronimo-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h4><a name="JBosstoGeronimo-JDBCMigration-Createthedatasourcedeploymentplan"></a>Create the data source deployment plan</h4>
+<p>First, create an xml file called <b>mysql-geronimo-plan.xml</b>. Copy the plan shown in the following example and paste it in the xml file.</p>
+<div class="code" style="border-style: solid; "><div class="codeHeader" style="border-bottom-style: solid; "><b>Data source deployment plan</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>
+
+&lt;connector xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/connector"</span> 
+           version=<span class="code-quote">"1.5"</span> configId=<span class="code-quote">"org/apache/geronimo/Mysql"</span> 
+           parentId=<span class="code-quote">"org/apache/geronimo/Server"</span>&gt;
+<span class="code-tag">&lt;dependency&gt;</span>
+  <span class="code-tag">&lt;uri&gt;</span>mysql/jars/mysql-connector-java-3.1.10-bin.jar<span class="code-tag">&lt;/uri&gt;</span>
+<span class="code-tag">&lt;/dependency&gt;</span>
+<span class="code-tag">&lt;resourceadapter&gt;</span>
+  <span class="code-tag">&lt;outbound-resourceadapter&gt;</span>
+    <span class="code-tag">&lt;connection-definition&gt;</span>
+      <span class="code-tag">&lt;connectionfactory-interface&gt;</span> 
+        javax.sql.DataSource 
+      <span class="code-tag">&lt;/connectionfactory-interface&gt;</span>
+      <span class="code-tag">&lt;connectiondefinition-instance&gt;</span>
+        <span class="code-tag">&lt;name&gt;</span>TradeDS<span class="code-tag">&lt;/name&gt;</span>
+        <span class="code-tag">&lt;config-property-setting name=<span class="code-quote">"UserName"</span>&gt;</span> 
+          root 
+        <span class="code-tag">&lt;/config-property-setting&gt;</span>
+        <span class="code-tag">&lt;config-property-setting name=<span class="code-quote">"Password"</span>&gt;</span> 
+          password
+        <span class="code-tag">&lt;/config-property-setting&gt;</span>
+        <span class="code-tag">&lt;config-property-setting name=<span class="code-quote">"Driver"</span>&gt;</span> 
+          com.mysql.jdbc.Driver 
+        <span class="code-tag">&lt;/config-property-setting&gt;</span>
+        <span class="code-tag">&lt;config-property-setting name=<span class="code-quote">"ConnectionURL"</span>&gt;</span>
+          jdbc:mysql://localhost:3306/tradedb
+        <span class="code-tag">&lt;/config-property-setting&gt;</span>
+        <span class="code-tag">&lt;config-property-setting name=<span class="code-quote">"CommitBeforeAutocommit"</span>&gt;</span> 
+           false 
+        <span class="code-tag">&lt;/config-property-setting&gt;</span>
+        <span class="code-tag">&lt;config-property-setting name=<span class="code-quote">"ExceptionSorterClass"</span>&gt;</span> 
+           org.tranql.connector.NoExceptionsAreFatalSorter
+        <span class="code-tag">&lt;/config-property-setting&gt;</span>
+
+        <span class="code-tag">&lt;connectionmanager&gt;</span>
+          <span class="code-tag">&lt;local-transaction/&gt;</span>
+          <span class="code-tag">&lt;single-pool&gt;</span>
+             <span class="code-tag">&lt;max-size&gt;</span>10<span class="code-tag">&lt;/max-size&gt;</span>
+             <span class="code-tag">&lt;min-size&gt;</span>0<span class="code-tag">&lt;/min-size&gt;</span>
+             <span class="code-tag">&lt;blocking-timeout-milliseconds&gt;</span> 
+                5000 
+              <span class="code-tag">&lt;/blocking-timeout-milliseconds&gt;</span>
+              <span class="code-tag">&lt;idle-timeout-minutes&gt;</span>
+                30
+              <span class="code-tag">&lt;/idle-timeout-minutes&gt;</span>
+              <span class="code-tag">&lt;match-one/&gt;</span>
+          <span class="code-tag">&lt;/single-pool&gt;</span>
+        <span class="code-tag">&lt;/connectionmanager&gt;</span>
+
+        <span class="code-tag">&lt;global-jndi-name&gt;</span> 
+          jdbc/TradeDB
+        <span class="code-tag">&lt;/global-jndi-name&gt;</span>
+
+      <span class="code-tag">&lt;/connectiondefinition-instance&gt;</span>
+    <span class="code-tag">&lt;/connection-definition&gt;</span>
+  <span class="code-tag">&lt;/outbound-resourceadapter&gt;</span>
+<span class="code-tag">&lt;/resourceadapter&gt;</span>
+<span class="code-tag">&lt;/connector&gt;</span></pre>
+</div></div>
+
+<p>The listing above shows the plan for deploying a J2EE connector which will provide JDBC access to the database. The root element is the &lt;connector&gt; element. This element has the following four attributes:</p>
+
+<ul>
+	<li>xmlns - specifies the XML namespace.</li>
+	<li>version - specifies that the J2EE connector conforms to the JCA 1.5 specification.</li>
+	<li>configId - specifies the name Geronimo uses to refer to the connector internally.</li>
+	<li>parentId - specifies the parent of this configuration.</li>
+</ul>
+
+
+<p>Other important elements and attributes are:</p>
+
+<ul>
+	<li>connectionfactory-interface - Must be javax.sql.DataSource.</li>
+	<li>connectiondefinition-instance - Contains the configuration properties required to connect to the database.</li>
+	<li>connectionmanager - Contains the configuration settings for the geronimo connection manager.</li>
+	<li>config-property-setting - Specifies the value of a single configuration property of the connector.</li>
+	<li>name - Name of the data source.</li>
+	<li>local-transaction - The presence of this element enables the resource adapter to support local transactions. If the 'no-transaction' element is present instead of 'local-transaction', then the resource adapter will not support transactions. If the 'xa-transaction' element is present instead of 'local-transaction', then the resource adapter will support xa-transactions.</li>
+	<li>single-pool - Contains the connection pool configuration properties such as max-size and min-size for a single pool. If the 'no-pool' element is present instead of 'single-pool', then the connections will not be pooled. If 'partitioned-pool' element is present instead of 'single-pool', then there will be a number of connection pools based on the partition type.</li>
+	<li>max-size - Maximum number of connections allowed simultaneously.</li>
+	<li>min-size  - Minimum size of the connection pool.</li>
+	<li>blocking-timeout-milliseconds - Time for which a caller will be made to wait for a connection, if all the connections in the pool are currently in use, before throwing an exception.</li>
+	<li>idle-timeout-minutes - Time in minutes after which a connection will timeout if it is idle.</li>
+	<li>global-jndi-name - This is the JNDI name used to access this data source from a client.</li>
+</ul>
+
+
+<p>The following table shows the configuration properties that are specified by the config-property-setting element.</p>
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'>Configuration Property</th>
+<th class='confluenceTh'>Meaning</th>
+</tr>
+<tr>
+<td class='confluenceTd'>Driver</td>
+<td class='confluenceTd'>Fully qualified class name of the JDBC driver.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>ConnectionURL</td>
+<td class='confluenceTd'>The JDBC connection URL. This can contain parameters when supported by the driver. For example, for MySQL to use named pipes instead of TCP/IP you can attach <tt>?socketFactory=com.mysql.jdbc.NamedPipeSocketFactory</tt> to the JDBC connection URL.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>UserName</td>
+<td class='confluenceTd'>The user name needed to connect to the database.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>Password</td>
+<td class='confluenceTd'>The password needed to connect to the database.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>CommitBeforeAutocommit</td>
+<td class='confluenceTd'>In case the JDBC driver does not commit the pending data changes when <tt>setAutoCommit</tt> (true) is called.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>ExceptionSorterClass</td>
+<td class='confluenceTd'>To provide information to the pool whether the Exceptions that occur are fatal or not.</td>
+</tr>
+</tbody></table>
+
+<p>After creating the MySQL deployment plan we need to deploy the connection pool datasource by running the deployer tool.  </p>
+
+<p>From a command line change directory to &lt;geronimo_home&gt; and run the following command:</p>
+
+<p>If the Geronimo instance is stopped:<br/>
+<tt>java -jar bin/deployer.jar distribute &lt;geronimo_home&gt;\repository\mysql\jars\mysql-geronimo-plan.xml &lt;geronimo_home&gt;\repository\tranql\rars\tranql-connector-1.0.rar</tt></p>
+
+<p>If the Geronimo instance is running:</p>
+
+<p><tt>java -jar bin/deployer.jar --user system --password manager deploy &lt;geronimo_home&gt;\repository\mysql\jars\mysql-geronimo-plan.xml &lt;geronimo_home&gt;\repository\tranql\rars\tranql-connector-1.0.rar</tt></p>
+
+<p>This will deploy the data source. Now you are ready to proceed with the migration.</p>
+
+<p><a href="#JBosstoGeronimo-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-JDBCMigration-Stepbystepmigration"></a>Step-by-step migration <a name="JBosstoGeronimo-JDBCMigration-migration"></a></h1>
+<p>Geronimo does not support accessing external resources(JDBC datasources) by setting JNDI properties at runtime as shown in the following example:</p>
+
+<div class="code" style="border-style: solid; "><div class="codeContent">
+<pre class="code-java">Context ctx = <span class="code-keyword">null</span>;
+Hashtable env = <span class="code-keyword">new</span> Hashtable();
+env.put(Context.INITIAL_CONTEXT_FACTORY, <span class="code-quote">"Geronimo specific factory"</span>); 
+env.put(Context.PROVIDER_URL, <span class="code-quote">"provider URL <span class="code-keyword">for</span> geronimo"</span>);
+     ctx = <span class="code-keyword">new</span> InitialContext(env)</pre>
+</div></div>
+
+<p>This is because reference resolution is done at deploy time and is based on the JSR-77 object names of the target component. In order to migrate the Online Brokerage application to Geronimo, you first need to replace the jboss-web.xml file with a geronimo-web.xml file which is the Geronimo-specific descriptor file. </p>
+
+<p>The geronimo-web.xml file is located in the &lt;brokerage_home&gt;\web\descriptors\geronimo directory and looks like the following example.</p>
+
+<div class="code" style="border-style: solid; "><div class="codeHeader" style="border-bottom-style: solid; "><b>geronimo-web.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">"ISO-8859-1"</span>?&gt;</span>
+&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">"BrokerageApp"</span> parentId=<span class="code-quote">"org/apache/geronimo/Mysql"</span>&gt;
+<span class="code-tag">&lt;context-root&gt;</span>/brokerage<span class="code-tag">&lt;/context-root&gt;</span>
+<span class="code-tag">&lt;naming:resource-ref&gt;</span>
+	<span class="code-tag">&lt;naming:ref-name&gt;</span>jdbc/TradeDB<span class="code-tag">&lt;/naming:ref-name&gt;</span>
+     <span class="code-tag">&lt;naming:resource-link&gt;</span>TradeDS<span class="code-tag">&lt;/naming:resource-link&gt;</span>
+<span class="code-tag">&lt;/naming:resource-ref&gt;</span>
+<span class="code-tag">&lt;/web-app&gt;</span></pre>
+</div></div>
+
+<p>As shown in the example, the parent for this configuration is the MySQL J2EE connector.  The naming:resource-ref element maps the TradeDS data source to the name jdbc/TradeDB.  The context-root element gives the context-root of the application.</p>
+
+<p>These are the only changes required to run this application on Geronimo.</p>
+
+<p>In order to build the .war file for Geronimo, you can modify the build.properties file that is provided with the sample application to remove the jboss-web.xml and include the geronimo-web.xml. This is done by changing the <b>server.name</b> property to geronimo.  Also you need to specify the property <b>geronimo.home</b> in the build script.</p>
+
+<p>The two values that you need to modify are:</p>
+
+<p><tt>server.name=geronimo</tt><br/>
+<tt>geronimo.home=&lt;geronimo_home&gt;</tt></p>
+
+<p>The build.properties is used by the build script to pick up the J2EE specs for Geronimo. If your <b>jboss.home</b> property is still valid, it is not required to set this property. If this property is not set and the jboss.home is also not valid then you will get compilation errors. You also need to set the <b>driver.classpath</b> to point to the new driver jar. Now from the command prompt go to the brokerage directory and run ant. This builds the war file and places it directly in the brokerage directory.</p>
+
+<p><a href="#JBosstoGeronimo-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-JDBCMigration-Deploythemigratedsampleapplication"></a>Deploy the migrated sample application</h2>
+<p>To deploy the migrated Online Brokerage 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><tt>java -jar bin/deployer.jar --user system --password manager deploy &lt;brokerage_home&gt;/brokerage.war</tt></p>
+
+<p>Once the application is deployed, open a Web browser and access the following URL:</p>
+
+<p><a href="http://localhost:8080/brokerage" title="Visit page outside Confluence">&#104;ttp://localhost:8080/brokerage</a></p>
+
+<p>Login with the same user name and password you used when testing the application from JBoss.</p>
+
+<p><a href="#JBosstoGeronimo-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-JDBCMigration-Summary"></a>Summary <a name="JBosstoGeronimo-JDBCMigration-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.</p>
+
+<p>The following list summarizes the major differences found during this sample application migration.</p>
+
+<ol>
+	<li>In the Geronimo specific deployment descriptor the resource reference name is mapped to the name of the datasource unlike in the JBoss specific deployment descriptor where the resource name is mapped to the JNDI name of the datasource.</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.</li>
+	<li>At this time, Geronimo does not support accessing external resources (i.e.:JDBC datasources) by setting JNDI properties at runtime. This resources need to be specified at deployment time.</li>
+</ol>
+
+
+<p><a href="#JBosstoGeronimo-JDBCMigration-top" title="top on JBoss to Geronimo - JDBC 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 - JDBC Migration_attachments/availableStocks.jpg">availableStocks.jpg</a> (image/pjpeg)
+                                <br/>
+                                                            <img src="icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="JBoss to Geronimo - JDBC Migration_attachments/brokerage.zip">brokerage.zip</a> (application/x-zip-compressed)
+                                <br/>
+                                                            <img src="icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="JBoss to Geronimo - JDBC Migration_attachments/JSP_flow.jpg">JSP_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 - JDBC Migration_attachments/JSP_flow.jpg
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20JDBC%20Migration_attachments/JSP_flow.jpg?rev=357449&view=auto
==============================================================================
Binary file - no diff available.

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

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

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

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

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

Added: geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - Security Migration.html
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20Security%20Migration.html?rev=357449&view=auto
==============================================================================
--- geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - Security Migration.html (added)
+++ geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss to Geronimo - Security Migration.html Sat Dec 17 22:04:20 2005
@@ -0,0 +1,377 @@
+<html>
+    <head>
+        <title>Documentation : JBoss to Geronimo - Security 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 - Security 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-SecurityMigration-top"></a><br/>
+<em><b>Article donated by:</b> <a href="mailto:dubrov@isg.axmor.com" title="Send mail to Ivan S Dubrov">Ivan S Dubrov</a>, <a href="mailto:artem@us.ibm.com" title="Send mail to Artem Papkov">Artem Papkov</a>, <a href="mailto:hcunico@gmail.com" title="Send mail to Hernan Cunico">Hernan Cunico</a></em></p>
+
+<h1><a name="JBosstoGeronimo-SecurityMigration-Overview"></a>Overview</h1>
+<p>This article will help you migrate security applications developed for JBoss v4 to Apache Geronimo. This article is part of a series of migration articles covering different types of applications migration.</p>
+
+<p>This article provides some details on the differences between these two application servers as well as a detailed step-by-step migration procedure for porting security application from JBoss v4 to Apache Geronimo. To define a common starting point (the source environment), this article provide steps for deploying the sample application into the JBoss source environment. Then you will be guided through the application migration and deployment process onto Apache Geronimo.</p>
+
+<p>This article is organized in the following sections:</p>
+
+<ul>
+	<li><a href="#JBosstoGeronimo-SecurityMigration-implementation" title="implementation on JBoss to Geronimo - Security Migration">Security implementation analysis</a></li>
+	<li><a href="#JBosstoGeronimo-SecurityMigration-sampleApp" title="sampleApp on JBoss to Geronimo - Security Migration">Sample application</a></li>
+	<li><a href="#JBosstoGeronimo-SecurityMigration-JBoss" title="JBoss on JBoss to Geronimo - Security Migration">The JBoss environment</a></li>
+	<li><a href="#JBosstoGeronimo-SecurityMigration-Geronimo" title="Geronimo on JBoss to Geronimo - Security Migration">The Geronimo environment</a></li>
+	<li><a href="#JBosstoGeronimo-SecurityMigration-migration" title="migration on JBoss to Geronimo - Security Migration">Step-by-step migration</a></li>
+	<li><a href="#JBosstoGeronimo-SecurityMigration-summary" title="summary on JBoss to Geronimo - Security Migration">Summary</a></li>
+</ul>
+
+
+<h1><a name="JBosstoGeronimo-SecurityMigration-Securityimplementationanalysis"></a>Security implementation analysis <a name="JBosstoGeronimo-SecurityMigration-implementation"></a></h1>
+<p>Support of J2EE features may vary from one vendor to another and different vendors provide different ways to extend respective specifications and default behaviors with custom ones. The purpose of this section is to provide comparison of similar JBoss and Geronimo features which were applied for the implementation of sample applications. You can use the information below to clearly identify the differences of these two servers and plan accordingly before migration from one to another.</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'>Custom login modules</td>
+<td class='confluenceTd'>Supports custom login modules. Custom login modules can be installed as part of the service archive (SAR).</td>
+<td class='confluenceTd'>Supports custom login modules</td>
+</tr>
+<tr>
+<td class='confluenceTd'>J2EE security</td>
+<td class='confluenceTd'>Supports both declarative and programmatic J2EE security.</td>
+<td class='confluenceTd'>Supports both declarative and programmatic J2EE security.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>Deploying realm configuration</td>
+<td class='confluenceTd'>Supports deployment of realm configuration as part of the service archive (SAR).</td>
+<td class='confluenceTd'>Realm configuration can be deployed as part of the module or as part of the application.</td>
+</tr>
+</tbody></table>
+
+<p><a href="#JBosstoGeronimo-SecurityMigration-top" title="top on JBoss to Geronimo - Security Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-SecurityMigration-Sampleapplication"></a>Sample application <a name="JBosstoGeronimo-SecurityMigration-sampleApp"></a></h1>
+<p>The <a href="http://localhost:9090/download/attachments/1566/security.zip?version=1" title="security.zip attached to JBoss to Geronimo - Security Migration">Security application</a>  represents a sample application that exploits security related features in the JBoss. It represents a simple document manager in which users can view and upload documents. It consists of the following three pages:</p>
+<ul>
+	<li>Login Page</li>
+	<li>Documents Page</li>
+	<li>Login Error Page</li>
+</ul>
+
+
+<p><img src="JBoss to Geronimo - Security Migration_attachments/secApp_flow.jpg" align="absmiddle" border="0" /></p>
+
+<p>The application starts with the Login page. After logging in the user is redirected to the Documents page. There are two types of users - viewers and editors. Both kinds can view documents, but only the editor can upload them.</p>
+
+<p>If a user has "editor" role, the upload form is displayed below the documents list. When the user selects a document and presses the "upload" button, the upload method of the BusinessLogic EJB  is invoked through the execution of the "Upload" servlet. The Security application will throw an exception if a non-authorized user attempts to call the upload servlet.</p>
+
+<p>Users are defined through the property files j2g_users.properties and j2g_groups.properties located in the &lt;security_home&gt;/properties directory.</p>
+
+<p>Two predefined users are "user" with password "1" and "editor" with password "2".</p>
+
+<p><a href="#JBosstoGeronimo-SecurityMigration-top" title="top on JBoss to Geronimo - Security Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-SecurityMigration-ApplicationclassesandJSPpages"></a>Application classes and JSP pages</h2>
+<p>The Application contains the following JSP pages:</p>
+<ul>
+	<li>login.jsp - The login page of the application.</li>
+	<li>loginError.jsp - The default error page of the application.</li>
+	<li>main.jsp - The main application page with documents list</li>
+	<li>upload Servlet - Servlet that handles the uploads</li>
+	<li>BusinessLogicEJB - Stateless Session EJB that handles uploads.</li>
+</ul>
+
+
+<p><a href="#JBosstoGeronimo-SecurityMigration-top" title="top on JBoss to Geronimo - Security Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-SecurityMigration-Toolsused"></a>Tools used</h2>
+<p>The tools used for developing and building security sample application are:</p>
+
+<h3><a name="JBosstoGeronimo-SecurityMigration-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>
+
+<p>JBoss plug-ins are also open source extensions for Eclipse that add some helpful features for creation of J2EE applications (which are not designed for deployment on JBoss only). These plug-ins can be downloaded from the following URL:</p>
+
+<p><a href="http://sf.net/projects/jboss" title="Visit page outside Confluence">&#104;ttp://sf.net/projects/jboss</a></p>
+
+<h3><a name="JBosstoGeronimo-SecurityMigration-ApacheAnt"></a>Apache Ant</h3>
+<p>Ant is a pure Java build tool. It is used for building the war files and populating the database for the Online Brokerage application. Ant can be downloaded from the following URL:</p>
+
+<p><a href="http://ant.apache.org" title="Visit page outside Confluence">&#104;ttp://ant.apache.org</a></p>
+
+<h3><a name="JBosstoGeronimo-SecurityMigration-XDoclet"></a>XDoclet</h3>
+<p>XDoclet is a tool for generating various artifacts (deployment descriptors, source code) basing on the JavaDoc tags. XDoclet can be downloaded from the following URL:</p>
+
+<p><a href="http://xdoclet.sourceforge.net" title="Visit page outside Confluence">&#104;ttp://xdoclet.sourceforge.net</a></p>
+
+<p><a href="#JBosstoGeronimo-SecurityMigration-top" title="top on JBoss to Geronimo - Security Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-SecurityMigration-TheJBossenvironment"></a>The JBoss environment <a name="JBosstoGeronimo-SecurityMigration-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.</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-SecurityMigration-top" title="top on JBoss to Geronimo - Security Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-SecurityMigration-Installandconfigureprerequisitesoftware"></a>Install and configure prerequisite software</h2>
+<p>Compilation of source code of the sample applications is based on Java libraries distributed along with JBoss. The only additional software which is required for building the applications is Apache Ant.</p>
+
+<h3><a name="JBosstoGeronimo-SecurityMigration-ApacheAnt"></a>Apache Ant</h3>
+<p>If you do not have Ant installed, this is a good time for doing so and making sure that <b>&lt;ant_home&gt;\bin</b> directory is added to the path system environment variable. Apache Ant can be downloaded from the following URL:</p>
+
+<p><a href="http://ant.apache.org" title="Visit page outside Confluence">&#104;ttp://ant.apache.org</a></p>
+
+<h3><a name="JBosstoGeronimo-SecurityMigration-XDoclet"></a>XDoclet</h3>
+<p>If you do not have XDoclet installed, this is a good time for doing so. Although XDoclet installation is not required to build the sources at this time. It will be required for modifying the source code. The XDoclet can be downloaded from the following URL:</p>
+
+<p><a href="http://xdoclet.sourceforge.net" title="Visit page outside Confluence">&#104;ttp://xdoclet.sourceforge.net</a></p>
+
+<p><a href="#JBosstoGeronimo-SecurityMigration-top" title="top on JBoss to Geronimo - Security Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-SecurityMigration-Buildthesampleapplication"></a>Build the sample application</h2>
+<p>The Security sample application included with this article provides an Ant script that you will use in order to build the application. Download the Securityapplication from the following link:</p>
+
+<p><a href="http://localhost:9090/download/attachments/1566/security.zip?version=1" title="security.zip attached to JBoss to Geronimo - Security Migration">Security Sample</a></p>
+
+<p>After extracting the zip file a security directory is created, from now on this directory will be referred as &lt;security_home&gt;. In that directory open the <b>build.properties</b> file and edit the properties to match your environment as shown in the following example:</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># Home directory of JBoss 4.0.2 J2ee Application Server and name of the server 
+# instance on which the application should be deployed (JBoss is also used for 
+# building purposes):
+jboss.home = &lt;jboss_home&gt;
+jboss.server = &lt;your_server_name&gt;</pre>
+</div></div>
+
+<p>After the properties are specified run the command <b>ant all</b> in the same directory. Ant will build the Enterprise application archive containing the sample application for JBoss. The archives together with any additional required files (if any) will be placed into the &lt;security_home&gt;/build/jboss directory.</p>
+
+<p><a href="#JBosstoGeronimo-SecurityMigration-top" title="top on JBoss to Geronimo - Security Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-SecurityMigration-Deploythesampleapplication"></a>Deploy the sample application</h2>
+<p>To deploy the Security application on JBoss, copy the <b>security.ear</b> from the &lt;security_home&gt;/build/jboss directory into the  &lt;jboss_home&gt;\server\&lt;your_server_name&gt;\deploy directory.</p>
+
+<p>If JBoss is running, it will automatically deploy and start the application. Otherwise, the application will be deployed and started at the next invocation of the application server.</p>
+
+<p><a href="#JBosstoGeronimo-SecurityMigration-top" title="top on JBoss to Geronimo - Security Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-SecurityMigration-Testthesampleapplication"></a>Test the sample application</h2>
+<p>To test the application, open a Web browser and access the following URL:</p>
+
+<p><a href="http://localhost:8080/security" title="Visit page outside Confluence">&#104;ttp://localhost:8080/security</a></p>
+
+<p>Try logging in as "user" and as "editor". Try invoking upload servlet directly typing the following URL in the browser <a href="http://localhost:8080/security/upload" title="Visit page outside Confluence">&#104;ttp://localhost:8080/security/upload</a>, you should receive an exception if you do not use an "editor" type user.</p>
+
+<p><img src="JBoss to Geronimo - Security Migration_attachments/Security_test.jpg" align="absmiddle" border="0" /></p>
+
+<p><a href="#JBosstoGeronimo-SecurityMigration-top" title="top on JBoss to Geronimo - Security Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-SecurityMigration-TheGeronimoenvironment"></a>The Geronimo environment <a name="JBosstoGeronimo-SecurityMigration-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-SecurityMigration-top" title="top on JBoss to Geronimo - Security Migration">Back to Top</a></p>
+
+<h1><a name="JBosstoGeronimo-SecurityMigration-Stepbystepmigration"></a>Step-by-step migration <a name="JBosstoGeronimo-SecurityMigration-migration"></a></h1>
+<p>Geronimo does not have an equivalent of the JBoss service archives (SARs). In the Security sample application, this archive is used for deploying the realm configuration on JBoss. In the case of Geronimo, this configuration can be placed in the application-wide Geronimo deployment plan <b>geronimo-application.xml</b>. </p>
+
+<p>The following steps were performed to migrate the sample application:</p>
+
+<ul class="alternate" type="square">
+	<li>Developed a Geronimo specific deployment plan for the Enterprise application. The <b>geronimo-application.xml</b> deployment plan is located in the &lt;security_home&gt;modules/security.ear/src/META-INF/geronimo directory. During the build process, this deployment plan is placed in the META-INF subdirectory in the EAR archive and should look like the following example:</li>
+</ul>
+
+
+<div class="code" style="border-style: solid; "><div class="codeHeader" style="border-bottom-style: solid; "><b>geronimo-application.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;application xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/application"</span>
+	configId=<span class="code-quote">"com/ibm/j2g/security"</span>
+	parentId=<span class="code-quote">"org/apache/geronimo/Server"</span>&gt;
+
+    <span class="code-tag">&lt;security xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/security"</span>&gt;</span>
+        <span class="code-tag">&lt;default-principal realm-name=<span class="code-quote">"j2g"</span>&gt;</span>
+            <span class="code-tag">&lt;principal class=<span class="code-quote">"org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"</span> name=<span class="code-quote">"system"</span>/&gt;</span>
+        <span class="code-tag">&lt;/default-principal&gt;</span>
+        <span class="code-tag">&lt;role-mappings&gt;</span>
+            <span class="code-tag">&lt;role role-name=<span class="code-quote">"authenticated"</span>&gt;</span>
+                <span class="code-tag">&lt;realm realm-name=<span class="code-quote">"j2g"</span>&gt;</span>
+                    <span class="code-tag">&lt;principal class=<span class="code-quote">"org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"</span> name=<span class="code-quote">"authenticated"</span>/&gt;</span>
+                <span class="code-tag">&lt;/realm&gt;</span>
+            <span class="code-tag">&lt;/role&gt;</span>
+            <span class="code-tag">&lt;role role-name=<span class="code-quote">"uploader"</span>&gt;</span>
+                <span class="code-tag">&lt;realm realm-name=<span class="code-quote">"j2g"</span>&gt;</span>
+                    <span class="code-tag">&lt;principal class=<span class="code-quote">"org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"</span> name=<span class="code-quote">"uploader"</span>/&gt;</span>
+               <span class="code-tag">&lt;/realm&gt;</span>
+            <span class="code-tag">&lt;/role&gt;</span>
+        <span class="code-tag">&lt;/role-mappings&gt;</span>
+    <span class="code-tag">&lt;/security&gt;</span>
+
+   	&lt;gb:gbean name=<span class="code-quote">"j2g-realm"</span> class=<span class="code-quote">"org.apache.geronimo.security.realm.GenericSecurityRealm"</span>
+   		<span class="code-keyword">xmlns:gb</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.0"</span>&gt;
+        <span class="code-tag">&lt;gb:reference name=<span class="code-quote">"ServerInfo"</span>&gt;</span>
+        	<span class="code-tag">&lt;gb:application&gt;</span>*<span class="code-tag">&lt;/gb:application&gt;</span>
+        	<span class="code-tag">&lt;gb:module&gt;</span>org/apache/geronimo/System<span class="code-tag">&lt;/gb:module&gt;</span>
+        	<span class="code-tag">&lt;gb:name&gt;</span>ServerInfo<span class="code-tag">&lt;/gb:name&gt;</span>
+        <span class="code-tag">&lt;/gb:reference&gt;</span>
+        <span class="code-tag">&lt;gb:reference name=<span class="code-quote">"LoginService"</span>&gt;</span>
+        	<span class="code-tag">&lt;gb:application&gt;</span>*<span class="code-tag">&lt;/gb:application&gt;</span>
+        	<span class="code-tag">&lt;gb:module&gt;</span>org/apache/geronimo/Security<span class="code-tag">&lt;/gb:module&gt;</span>
+        	<span class="code-tag">&lt;gb:name&gt;</span>JaasLoginService<span class="code-tag">&lt;/gb:name&gt;</span>
+        <span class="code-tag">&lt;/gb:reference&gt;</span>
+    	<span class="code-tag">&lt;gb:attribute name=<span class="code-quote">"realmName"</span>&gt;</span>j2g<span class="code-tag">&lt;/gb:attribute&gt;</span>
+    	<span class="code-tag">&lt;gb:xml-reference name=<span class="code-quote">"LoginModuleConfiguration"</span>&gt;</span>
+    		<span class="code-tag">&lt;l:login-config <span class="code-keyword">xmlns:l</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/loginconfig"</span>&gt;</span>
+    			<span class="code-tag">&lt;l:login-module control-flag=<span class="code-quote">"REQUIRED"</span> server-side=<span class="code-quote">"true"</span>&gt;</span>
+    				<span class="code-tag">&lt;l:login-domain-name&gt;</span>j2g<span class="code-tag">&lt;/l:login-domain-name&gt;</span>
+    				<span class="code-tag">&lt;l:login-module-class&gt;</span>
+    					org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule
+    				<span class="code-tag">&lt;/l:login-module-class&gt;</span>
+     				<span class="code-tag">&lt;l:option name=<span class="code-quote">"usersURI"</span>&gt;</span>
+				    	var/security/j2g_users.properties
+			        <span class="code-tag">&lt;/l:option&gt;</span>
+        			<span class="code-tag">&lt;l:option name=<span class="code-quote">"groupsURI"</span>&gt;</span>
+          				var/security/j2g_groups.properties
+        			<span class="code-tag">&lt;/l:option&gt;</span>
+    			<span class="code-tag">&lt;/l:login-module&gt;</span>
+    		<span class="code-tag">&lt;/l:login-config&gt;</span>
+    	<span class="code-tag">&lt;/gb:xml-reference&gt;</span>
+    <span class="code-tag">&lt;/gb:gbean&gt;</span>
+<span class="code-tag">&lt;/application&gt;</span></pre>
+</div></div>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='infoMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>Note that in contrast to JBoss, application roles must be explicitly defined in the deployment plan.</td></tr></table>
+
+<ul class="alternate" type="square">
+	<li>Created a Geronimo specific deployment plan for the EJB module <b>openejb-jar.xml</b>. This deployment plan is located in the &lt;security_home&gt;/modules/security.jar/src/META-INF/geronimo/openejb-jar.xml. During the build the file is copied to the META-INF subdirectory of the security.jar EJB module. This deployment plan should look like the following example:</li>
+</ul>
+
+
+<div class="code" style="border-style: solid; "><div class="codeHeader" style="border-bottom-style: solid; "><b>openejb-jar.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>
+&lt;openejb-jar xmlns=<span class="code-quote">"http://www.openejb.org/xml/ns/openejb-jar"</span>
+    configId=<span class="code-quote">"com/ibm/j2g/security/ejb"</span> parentId=<span class="code-quote">"com/ibm/j2g/security"</span>&gt;
+    <span class="code-tag">&lt;enterprise-beans&gt;</span>
+    	<span class="code-tag">&lt;session&gt;</span>
+    		<span class="code-tag">&lt;ejb-name&gt;</span>BusinessLogic<span class="code-tag">&lt;/ejb-name&gt;</span>
+    	<span class="code-tag">&lt;/session&gt;</span>
+    <span class="code-tag">&lt;/enterprise-beans&gt;</span>
+<span class="code-tag">&lt;/openejb-jar&gt;</span></pre>
+</div></div>
+
+<ul class="alternate" type="square">
+	<li>Created a Geronimo specificdeployment plan for the Web module <b>geronimo-web.xml</b>. This plan is located in the security/modules/security.war/src/WEB-INF/geronimo/geronimo-web.xml. During the build, this file is copied to the WEB-INF subdirectory of the security.war Web module. This deployment plan should look like the following example:</li>
+</ul>
+
+
+<div class="code" style="border-style: solid; "><div class="codeHeader" style="border-bottom-style: solid; "><b>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> 
+   configId=<span class="code-quote">"com/ibm/j2g/security/web"</span> parentId=<span class="code-quote">"com/ibm/j2g/security"</span>&gt;
+    <span class="code-tag">&lt;context-root&gt;</span>/security<span class="code-tag">&lt;/context-root&gt;</span>
+    <span class="code-tag">&lt;context-priority-classloader&gt;</span>true<span class="code-tag">&lt;/context-priority-classloader&gt;</span>
+    <span class="code-tag">&lt;security-realm-name&gt;</span>j2g<span class="code-tag">&lt;/security-realm-name&gt;</span> 
+<span class="code-tag">&lt;/web-app&gt;</span></pre>
+</div></div>
+
+<ul class="alternate" type="square">
+	<li>Rewrited the properties files with users to group mapping. JBoss login module have mapping in the form of "user=group1,group2" and Geronimo have mapping in the form of "group=user1,user2".</li>
+</ul>
+
+
+<p>Since the realm configuration is done in the geronimo-application.xml, the SAR archive is not required anymore. Actually, this archive can contain custom login modules as well, but since there is some difficulties regarding the deployment of custom login modules to Geronimo (see JIRA <a href="http://issues.apache.org/jira/browse/GERONIMO-1044" title="Visit page outside Confluence">GERONIMO-1044</a> ) they are not covered in this article.</p>
+
+<p><a href="#JBosstoGeronimo-SecurityMigration-top" title="top on JBoss to Geronimo - Security Migration">Back to Top</a></p>
+
+<h2><a name="JBosstoGeronimo-SecurityMigration-Buildthemigratedsampleapplication"></a>Build the migrated sample application</h2>
+<p>In order to build modules of the Security application file for Geronimo, make sure that the properties starting with the prefix <b>jboss</b> still match your environment. The build scripts still refer to JBoss libraries for J2EE API interfaces required for the source code compilation.</p>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='infoMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>You can update the classpath in the <b>build.xml</b> file to point to Geronimo and get the jars from there and not from JBoss.</td></tr></table>
+
+<p>After the properties have been  specified, run the <b>ant all</b> command in the &lt;security_home&gt; directory. Ant will build the Enterprise application archive containing the sample application for Geronimo. The archives together with additional required files (if any) will be placed in the &lt;security_home&gt;/build/geronimo directory.</p>
+
+<p>The build system was updated to include Geronimo-specific deployment plan in the application modules. SAR archive was removed from the build.</p>
+
+<h2><a name="JBosstoGeronimo-SecurityMigration-Deploythemigratedsampleapplication"></a>Deploy the migrated sample application</h2>
+<p>To deploy the migrated Security application, make sure the Geronimo server is up and running.</p>
+
+<p>Copy the properties files with users and groups definition from the &lt;security_home&gt;/properties directory to the &lt;geronimo_home&gt;/var/security directory</p>
+
+<p>From a command line, change directory to &lt;geronimo_home&gt;/bin and type the following command:</p>
+
+<p>java -jar deployer.jar --user system --password manager deploy &lt;security_home&gt;/build/geronimo/security.ear</p>
+
+<p>Once the application is deployed, open a Web browser and access the following URL:</p>
+
+<p><a href="http://localhost:8080/security" title="Visit page outside Confluence">&#104;ttp://localhost:8080/security</a></p>
+
+<p>Login with the same user name and password you used when testing the application from JBoss.</p>
+
+<h1><a name="JBosstoGeronimo-SecurityMigration-Summary"></a>Summary <a name="JBosstoGeronimo-SecurityMigration-summary"></a></h1>
+<p>This article showed you how to migrate a Security application that exploits some of the J2EE security-related features such as EJB declarative security, Web declarative security and Web programmatic security. </p>
+
+<p>In both environments built-in login module was used. This article showed that such kind of applications require minimal migration efforts, although in more complex cases there could be more time-consuming issues.</p>
+
+<p><a href="#JBosstoGeronimo-SecurityMigration-top" title="top on JBoss to Geronimo - Security 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 - Security Migration_attachments/secApp_flow.jpg">secApp_flow.jpg</a> (image/pjpeg)
+                                <br/>
+                                                            <img src="icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="JBoss to Geronimo - Security Migration_attachments/security.zip">security.zip</a> (application/x-zip-compressed)
+                                <br/>
+                                                            <img src="icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="JBoss to Geronimo - Security Migration_attachments/Security_test.jpg">Security_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 - Security Migration_attachments/Security_test.jpg
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/scripts/src/resources/docs/JBoss%20to%20Geronimo%20-%20Security%20Migration_attachments/Security_test.jpg?rev=357449&view=auto
==============================================================================
Binary file - no diff available.

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

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

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

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

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



Mime
View raw message