Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Anchortoptop
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 that come with Enterprise Java Beans: Bean-Managed Persistence(BMP) and Container-Managed Persistent(CMP). This article covers the migration of a BMP sample application. 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.

...

BMP implementation analysis Anchor analysisanalysis

BMP implementation may vary from one vendor to another. The purpose of this section is to provide a BMP specific feature-to-feature comparison between JBoss v4.0.5 and Apache Geronimo, so that you can clearly identify the differences and plan accordingly before migration.

...

Back to Top

Sample application Anchorsamplesample

This is a simple loan registration application which allows users to apply for loans and administrators to approve/reject the loans. Customers can apply for loans using the Web site while the manager uses a simple Java application to approval/reject loans. BMP Entity Bean has been used to manage Loan related persistence data from a database. In addition to that a Stateless Session Bean has been used handle work flow related activities.

...

Back to Top

The JBoss environment Anchorjbossjboss

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.5 was used.

...

Make sure JBoss is not running at the time of modifying this file.

...

After extracting the zip file, a loan directory is created. In that directory open the build.properties file and edit the properties to match your environment as shown in the following example:

...

Before starting the build process just set the correct paths for the geronimo.home and xdoclet.home entries in the build.properties file in the config directory.

...

Make sure you add the jboss-all-client.jar file to your class path before running the above command.

...

Back to Top

The Geronimo environment Anchorgeronimogeronimo geronimo

Download Download and install Geronimo from the following URL:

...

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 <geronimo_home>.

...

...

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.

...

Back to Top

Step-by-step migration Anchor migration migration

When you built the loan manager sample application, Ant packaged the deployment descriptors for both JBoss jboss.xml and Geronimo openejb-jar.xml as they were already provided by the sample application. These files are located in the loan/config directory.

The following example shows the JBoss deployment descriptor.

...

Compare it with the contents of the Geronimo deployment plan shown in the following example.

...

...

First difference can be clearly noted is Geronimo specific configuration has additional information than JBoss specific one. That part of the Geronimo configuration file is quite similar to a Maven 2 build script. Both of these given configuration files have EJB information. JBoss uses local JNDI names to link the EJBs while Geronimo directly use the EJB's name. In addition to above differences the openejb-jar.xml file clearly gives the EJB reference information than the jboss.xml file.

The Web archive related configuration files give you few more differences.

...

...

jboss-web.xml maps the EJBs using JNDI names as given above while geronimo-web.xml directly uses the EJB's name. The reference names given in each mapping will be used refer EJBs from the Servlets. web.xml file of the WAR file contains more information about each EJB reference name, which will be common to the both Geronimo and JBoss flavors of this application.

...

java -jar LoanStatusChanger.jar <loanId> <status>

...

Make sure you add the following list of JAR files to your class path before running the above command.

  1. geronimo-kernel-1.x.jar
  2. geronimo-j2ee_1.4_spec-1.x.jar
  3. geronimo-security-1.x.jar
  4. cglib-nodep-2.1_3.jar
  5. openejb-core-2.1.jar

...

Back to Top

Summary Anchorsummarysummary

This article has shown how to migrate a sample application that uses BMP entity beans, from JBoss v4.0.5 to Apache Geronimo. This article provided step-by-step instructions to build the application, deploy and run it, and then migrate it to the Geronimo environment.

...