Oracle Application Server 10g Migrating from Oracle Application Server 10g (9.0.4) Part Number B10424-01 |
|
This chapter provides information on migrating EJB, ECO for Java and JCO applications from the Oracle Application Server to OC4J in Oracle Application Server 10g.
Topics discussed are:
To migrate EJBs from Oracle Application Server 4.x to OC4J, you must modify code in the following areas:
The following sections describe these changes.
OC4J conforms to XML file configuration that complies to J2EE 1.2 specifications.
See Also:
Oracle Application Server Containers for J2EE Support for JavaServer Pages Developer's Guide |
Changes to the client code are made in the initial context call using JNDI. The hashtable passed to the initial context call must contain all of the following properties:
javax.naming.Context.URL_PKG_PREFIXES
javax.naming.Context.SECURITY_AUTHORIZATION
javax.naming.Context.SECURITY_PRINCIPAL
javax.naming.Context.SECURITY_CREDENTIALS
You must also change the URL that accesses your EJB home to the OC4J:
ORMI://<host>:<port>/<path>/<bean>
For example:
ORMI://myhost:2481/test/myBean ORMI://host/port/est/bean
If application logging was done in Oracle Application Server, remove all references to oracle.oas.ejb.Logger
from your EJB code.
When migrating ECO for Java (ECO/Java) in Oracle Application Server to OC4J in Oracle Application Server 10g, you must change server code described in this section, as well as change deployment descriptors and client code described in the previous section for EJB migration.
To make your ECO/Java components compatible with OC4J, you must modify the implementation file, the remote interface file, the home interface file, and deployment descriptors.
Change the remote interface to extend javax.ejb.EJBObject
instead of oracle.oas.eco.ECOObject
. Each method must throw java.rmi.RemoteException
.
Change the home interface to extend javax.ejb.EJBHome
instead of oracle.oas.eco.ECOHome
.
The created method must throw javax.ejb.CreateException
and java.rmi.RemoteException
instead of oracle.oas.eco.CreateException
.
Make the following changes to the implementation class:
oracle.oas.eco.Logger
.
oracle.oas.eco.*
to javax.ejb.*
.
ECOCreate
method to ejbCreate
method.
ECORemove
method to ejbRemove
method.
ECOActivate
method to ejbActivate
method.
ECOPassivate
method to ejbPassivate
method.
Oracle Application Server versions 4.0.6 and 4.0.7 provided a component model, Java CORBA Objects (JCO), which is a precursor to the ECO/Java model. Oracle Application Server 10g does not support CORBA objects. You must recode your CORBA objects as EJBs. This section discusses migration from JCO in Oracle Application Server to OC4J in Oracle Application Server 10g.
To migrate to OC4J, you must modify the server and client code as discussed in this section. To modify the server code, you must modify the remote interface, create a home interface, modify the JCORBA object implementation, and make parameters serializable.
See Also:
You must also modify the deployment descriptors as discussed in "Deployment Descriptors". |
Make the following changes to the remote interface:
org.omg.CORBA.Object
or oracle.oas.jco.JCORemote
to javax.ejb.EJBObject
.
java.rmi.RemoteException
for all methods in the interface.
You must to create a home interface, as defined in the EJB specification. The following is an example.
import javax.ejb.*; import java.rmi.RemoteException; public interface ServerStackHome extends EJBHome { public ServerStackRemote create() throws CreateException, RemoteException; }
Complete the following steps to migrate the implementation class:
oracle.oas.jco.*
to import javax.ejb.*
.
javax.ejb.SessionBean
, or javax.ejb.EntityBean
.
The JCORBA Lifecycle is not supported within OC4J. If the JCORBA object implements
Note:
oracle.oas.jco.Lifecycle
, you must remove it.
ejbCreate()
method.
setSessionContext()
method in an instance variable.
java.rmi.RemoteException
.
ObjectManager
type to SessionContext
type. Table 4-1 maps the methods in the ObjectManager
class to methods in the SessionContext
class.
Table 4-1 ObjectManager and SessionContext Methods
If any user-defined parameters are being passed in the remote interface, ensure that the classes implement java.io.Serializable
.
|
![]() Copyright © 2002, 2003 Oracle Corporation. All Rights Reserved. |
|