![Red Hat Application Server Manual Download Page 277](http://html.mh-extra.com/html/red-hat/application-server/application-server_manual_1427406277.webp)
Chapter 39.
How to Migrate the New World Cruises
Application to JOnAS
This section describes the modifications required to migrate the J2EE application “New World Cruise”
to a JOnAS server.
“New World Cruise” is a sample application that comes with Sun ONE Application Server. (See
http://developers.sun.com/sw/building/tech_articles/jaxrpc/synopsis.html.)
39.1. JOnAS Configuration
The first step is to configure the database used for this application. Copy the file
db
.properties
to
the directory
$JONAS_BASE/conf
. Edit this file to complete the database connection.
Then,
modify
the
JOnAS
DBM
database
service
configurations
in
the
file
$JONAS_BASE/conf/jonas.properties
, to specify the file containing the database connection.
39.1.1. New World Cruise Application
39.1.1.1. EJB Modification Code
To be EJB2.0-compliant, add the exceptions RemoveException and CreateException for EJB’s meth-
ods ejbRemove and ejbCreate.
Additionally, the GlueBean class uses a local object in GlueBean constructor. However, it must use a
remote object because it is a class calling an EJB. Therefore, modify the comment in this class with
the following:
// If using the remote interface, the call would look like this
cruiseManagerHome = (CruiseManagerHome)
javax.rmi.PortableRemoteObject.narrow(result, CruiseManagerHome.class);
// Using the local interface, the call looks like this
//cruiseManagerHome = (CruiseManagerHome) result;
39.1.2. EJB’s Deployment Descriptor
There are three EJBs, thus there must be three
ejb-jar.xml
files that correspond to the EJB’s de-
ployment descriptors and three
jonas-ejb-jar.xml
files that correspond to the JOnAS deployment
descriptors.
First, rename the files
ejb_name
.ejbdd
with
ejb_name
.xml
(these files contain the EJB deploy-
ment descriptors).
Create the three
jonas-
ejb_name
.xml
files corresponding to the EJBs.
For the two entity Beans (Cruise and CruiseManager), describe the mapping between:
•
The EJB name and JNDI name (JNDI name=ejb/
ejb name
)
•
The JDBC and the table name
•
The EJB field and the table field, (the version of CMP is not specified in ejb-jar and JOnAS by
default uses CMP1.1).
Summary of Contents for Application Server
Page 1: ...Red Hat Application Server JOnAS User Guide ...
Page 8: ......
Page 22: ...14 Chapter 1 Java Open Application Server JOnAS a J2EE Platform ...
Page 58: ...50 Chapter 3 JOnAS Configuration ...
Page 66: ...58 Chapter 5 JOnAS Class Loader Hierarchy ...
Page 78: ...70 Chapter 6 JOnAS Command Reference ...
Page 80: ......
Page 86: ...78 Chapter 7 Developing Session Beans ...
Page 136: ...128 Chapter 9 Developing Message Driven Beans ...
Page 142: ...134 Chapter 10 Defining the Deployment Descriptor ...
Page 148: ...140 Chapter 11 Transactional Behavior of EJB Applications ...
Page 158: ...150 Chapter 14 EJB Packaging ...
Page 162: ...154 Chapter 15 Application Deployment and Installation Guide ...
Page 164: ......
Page 176: ...168 Chapter 18 WAR Packaging ...
Page 178: ......
Page 184: ...176 Chapter 20 Defining the Client Deployment Descriptor ...
Page 186: ...178 Chapter 21 Client Packaging ...
Page 188: ......
Page 192: ...184 Chapter 23 EAR Packaging ...
Page 194: ......
Page 200: ...192 Chapter 24 JOnAS Services ...
Page 204: ...196 Chapter 25 JOnAS and the Connector Architecture ...
Page 222: ...214 Chapter 27 Ant EJB Tasks Using EJB JAR ...
Page 234: ...226 Chapter 29 Web Services with JOnAS ...
Page 236: ......
Page 260: ...252 Chapter 34 How to use Axis in JOnAS ...
Page 270: ...262 Chapter 36 Web Service Interoperability between JOnAS and BEA WebLogic ...
Page 296: ......