|
Upgrading EJBs to WebLogic Server Version 5.1
Compiled classes and interfaces
Step 1: Convert the text deployment descriptor
Step 2: Package EJB Classes and Interfaces
Step 3: Edit deployment properties and check compliance
Overview
WebLogic Server Version 5.1 provides an updated implementation of the Enterprise JavaBeans API that is compliant with JavaSoft's EJB 1.1 specification. To use existing EJBs with WebLogic Server Version 5.1, you must ensure that all components of your EJB system - the EJB classes, interfaces, clients, and deployment descriptors - are compliant with the new specification.
This section describes how to upgrade an existing EJB deployment unit to work with WebLogic Server. The upgrade process involves the following steps, each of which is described in the next sections:
To convert an existing WebLogic Server EJB deployment, you must have the following:
Note: The WebLogic Server conversion utilities cannot update deployment description files from non-WebLogic Server application servers.
Obtain the WebLogic Server text deployment description of the deployment unit you want to upgrade. The text description file must be compatible with an earlier version of WebLogic Server. For example, you should be able to successfully create a .ser file from the text description using tools included with your earlier WebLogic Server version.
Note: You cannot use an existing .ser file with the DDConverter tool. Instead, obtain the text description file that you used to generate the .ser.
Compiled classes and interfaces
Your EJB classes, home interfaces, and remote interfaces must be compiled using a supported JDK. (See WebLogic Platform Support for more information.) Ideally, you should also make the changes to EJB code described in Required changes for EJB 1.1 compliance before compiling.
If you did not yet update your code to observe the EJB 1.1 restrictions, you can still begin converting the deployment unit to WebLogic Server Version 5.1. However, DeployerTool may indicate that the code in the final .jar file is not 1.1 compliant. In this case, you will need to fix all reported problems, recompile, and repackage the .jar before actually deploying the EJB.
Step 1: Convert the text deployment descriptor
In WebLogic Server Version 5.1, XML deployment descriptors replace serialized descriptors as the means of defining deployment properties. WebLogic Server provides the DDConverter utility to generate 1.1-compliant XML files. DDConverter takes an existing WebLogic Server text description and generates the following XML files:
Follow these steps to upgrade an existing 1.0-compliant WebLogic Server EJB text descriptor to the required 1.1-compliant XML files:
$ cd \weblogic_old\testbean1
$ mkdir converted_xml
$ cd \weblogic51
$ setenv
$ java weblogic.ejb.utils.DDConverter -d targetDir oldDDFile
where:
For example:
$ cd \weblogic_old\testbean1
$ java weblogic.ejb.utils.DDConverter -d converted_xml
DeploymentDescriptor.txt
DDConverter updates 1.0 properties to their 1.1-equivalent properties and creates new XML files in the specified directory. DDConverter displays non-fatal error messages if any 1.0 properties are no longer used in WebLogic Server Version 5.1, or if "placeholder" values are used to define required Version 5.1 properties.
Error Action All user defined <env-entry> items were set to String. You will need to manually change the types as necessary. Continue with
Step 2: Package EJB Classes and Interfaces. Then follow the instructions in
Step 3: Edit deployment properties and check compliance to change assigned environment entry types to their correct Java types. You will also need to change your EJB implementation to access environment entries using JNDI. See
EJBContext.getEnvironment() Deprecated for more information. Required tag <ejb-name> was set arbitrarily to the JNDI name for the bean: bean_name. You should manually change the tag. If you want to accept the default EJB name, no action is required. To change the default name, open both the ejb-jar.xml and weblogic-ejb-jar.xml files with a text editor, and change the name specified in the ejb-name property. For example: <ejb-name>new.ejb.name</ejb-name> Always make identical changes to the ejb-name in both ejb-jar.xml and weblogic-ejb-jar.xml. runAsMode is no longer supported. Property is not being set for method: method_name No action is required.
Optional conversion tasks
When DDConverter updates the deployment descriptor for an entity bean with container-managed persistence, it always defines a compound primary key in the ejb-jar.xml deployment file. If your bean uses a simple primary key, consider editing ejb-jar.xml to define a simple key. See Primary key changes for container-managed EJBs for more information.
Also, you may want to change the default value of the jndi-name property in ejb-jar.xml. During the upgrade process, DDConverter sets jndi-name to the value of the beanHomeName property from your 1.0 text deployment file.
Step 2: Package EJB Classes and Interfaces
The converted XML description files, along with compiled EJB classes, must be packaged into a .jar file before compiling stubs and skeleton classes with ejbc or loading into the WebLogic Server DeployerTool. The structure of the EJB .jar file must observe the following requirements:
The following steps explain how to create an EJB 1.1-compliant .jar file that you can load into the WebLogic Server DeployerTool utility:
$ mkdir jartemp
$ cd jartemp
$ mkdir META-INF
For example, if you store your EJB files in the package examples.ejb.basic.beanManaged, create the directories:
$ mkdir examples
$ mkdir examples\ejb
$ mkdir examples\ejb\basic
$ mkdir examples\ejb\basic\beanManaged
$ copy c:\dev\examples\ejb\basic\beanManaged\*.class c:\jartemp\examples\ejb\basic\beanManaged
$ copy c:\dev\ejb\basic\beanManaged\converted_xml\*.xml c:\jartemp\META-INF
$ jar cf beanManaged.jar examples\ejb\basic\beanManaged META-INF
Note: You do not need to include a MANIFEST file in the .jar file, as was required with the EJB 1.0 specification.
For example:
$ jar tf beanManaged.jar
META-INF/
META-INF/MANIFEST.MF
examples/ejb/basic/beanManaged/
examples/ejb/basic/beanManaged/Account.class
examples/ejb/basic/beanManaged/AccountBean.class
examples/ejb/basic/beanManaged/AccountHome.class
examples/ejb/basic/beanManaged/AccountPK.class
examples/ejb/basic/beanManaged/ProcessingErrorException.class
META-INF/ejb-jar.xml
META-INF/weblogic-ejb-jar.xml
Follow the steps in Step 3: Edit deployment properties and check compliance to load the new .jar file into DeployerTool.
Step 3: Edit deployment properties and check compliance
The EJB 1.1 specification defines new deployment properties that were not part of the text deployment description you converted in Step 1: Convert the text deployment descriptor. Follow the steps below to load the EJB deployment unit into the WebLogic Server DeployerTool utility and:
To open the EJB deployment .jar in DeployerTool:
$ cd \weblogic51
$ setenv
% java -ms24m -mx24m weblogic.EJBDeployerTool
If you installed WebLogic Server under Windows NT, you can also start DeployerTool using the Start menu.
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|