This section provides notes on J2EE application migration.
Developing J2EE applications that operate under older versions of Interstage Application Server
If a J2EE application project has been migrated, the server runtime becomes "Interstage Application Server V11.1 IJServer (J2EE)" by default. For J2EE application projects that operate under older versions of Interstage Application Server, the server runtime must be changed at [Targeted Runtimes] under the project properties.
Note
When developing a J2EE application that operates under an older version of Interstage Application Server, do not install the application server during installation. Instead, the client package for the version of Interstage Application Server to be used for the development must be installed, and a server in a remote environment must be used to perform debugging.
Changing the execution environment from IJServer(J2EE) to IJServer Cluster
If a J2EE application that was operating under an older version of Interstage Application Server is run in an IJServer Cluster, the server runtime must be changed at [Targeted Runtimes] under the project properties.
Note
The following notes apply to J2EE applications:
Enterprise Bean (Container-managed Persistence)
The CMP extension information files are for operating under IJServer(J2EE). To operate in an IJServer Cluster, consult the Interstage Application Server manual and change the files to those for IJServer (cluster).
Web service
Web services (JAX-RPC) operating under IJServer(J2EE) cannot be executed in an IJServer Cluster. Refer to the Interstage Application Server manual for details.
Migration from a J2EE application to a Java EE application
To migrate a J2EE application to a Java EE application, refer to the modified points of each application and update the application.
Web application: "2.1.1.1 Modifications since J2EE1.4"
Enterprise JavaBeans (EJB): "3.1.1.1 Modifications since J2EE1.4"
Java Persistence API: "4.1.1.1 Modifications since EJB2.1"
Web service: "5.1.1.1 Modifications since J2EE1.4"
Migration from EJB2.0 to EJB2.1
To migrate to EJB2.1 resources that obey EJB2.0 specification, follow the procedures below.
Note
If migrating to EJB2.1, EJB Applications on the Interstage Application Server cannot be accessed from the remote environment.
1) Create a new project
Create a new EJB project using the EJB project wizard - select [2.1] in [EJB Module Version] in the wizard.
2) Import old resources
Use the Import wizard to import the old resources.
Select [File] > [Import] from the menu bar to start the Import wizard. Select [General] > [File System] in [Select] to import the necessary resources (source file, deployment descriptors and so on). Store the deployment descriptors to the META-INF folder in the source folder. A deployment descriptor is generated when an EJB project is created. Overwrite the deployment descriptor of the existing resources at import time.
Point
Remove the following folders from the import target:
.externalToolBuilders
.settings
bin
src
distribute
3) Update the deployment descriptor
Modify the deployment descriptor from EJB2.0 to EJB2.1 format. The deployment descriptor must be opened in the XML Editor and modified directly.
Modify the deployment descriptor Schema definition from DTD to XML Schema.
Define the XML Schema as shown below:
EJB2.0
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
EJB2.1
<?xml version="1.0" encoding="UTF-8"?> <ejb-jar version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"> </ejb-jar>
Modify tag configuration.
Correct tag configurations and tags for values that have changed from EJB2.0 to EJB2.1.
<small-icon>, <large-icon> tags
Modify icon specification tags <small-icon> and <large-icon> so that they are enclosed by <icon> tag:
EJB2.0
<small-icon>icon/small.gif</small-icon> <large-icon>icon/large.gif</large-icon>
EJB2.1
<icon> <small-icon>icon/small.gif</small-icon> <large-icon>icon/large.gif</large-icon> </icon>
<reentrant> tags
Modify the values of the <reentrant> tag to lowercase:
EJB2.0
<prim-key-class>sample.EventPrimaryKey</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
EJB2.1
<prim-key-class>sample.EventPrimaryKey</prim-key-class>
<reentrant>false</reentrant>
<cmp-version>2.x</cmp-version>
<security-role-ref>, <security-identity> tags
Modify the position of the <security-role-ref> and <security-identity> tags from between the EJB reference tags (<ejb-ref>, <ejb-local-ref>) and resource reference tags (<resource-ref>, <resource-env-ref>) to after the resource reference tags:
EJB2.0
<ejb-local-ref> Omitted </ejb-local-ref> <security-role-ref> <role-name>Security1</role-name> <role-link>Security1</role-link> </security-role-ref> <security-identity> <run-as> <role-name>Security1</role-name> </run-as> </security-identity> <resource-ref> Omitted </resource-ref>
EJB2.1
<ejb-local-ref> Omitted </ejb-local-ref> <resource-ref> Omitted </resource-ref> <security-role-ref> <role-name>Security1</role-name> <role-link>Security1</role-link> </security-role-ref> <security-identity> <run-as> <role-name>Security1</role-name> </run-as> </security-identity>
Modify Message-driven Bean-related tags
The following Message-driven Bean tags have been deleted. Redefine the property name and value in the <activation-config> tag.
<message-selector>
<acknowledge-mode>
<message-driven-destination>
<destination-type>
<subscription-durability>
The method for specifying the property is described below. Note that the <message-driven-destination> tag does not have a value.
EJB2.0 Tag | EJB2.1 Tag | |
---|---|---|
Property Name | Value | |
message-selector | messageSelector | Any character string |
acknowledge-mode | acknowledgeMode | Specify one of the following.
|
destination-type | destinationType | Specify one of the following.
|
subscription-durability | subscriptionDurability | Specify one of the following.
|
The following is an example of settings.
<message-driven> Omitted <activation-config> <activation-config-property> <activation-config-property-name> messageSelector </activation-config-property-name> <activation-config-property-value> JMSType = 'car' AND color = 'blue'</activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name> destinationType </activation-config-property-name> <activation-config-property-value> javax.jms.Topic </activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name> subscriptionDurability </activation-config-property-name> <activation-config-property-value> NonDurable </activation-config-property-value> </activation-config-property> </activation-config> </message-driven>
4) Java Source Correction
The source file does not need to be modified when migrating from EJB2.0 to EJB2.1.
Migration from EJB1.0 or EJB1.1 to EJB2.0
To migrate to EJB2.0 resources that obey EJB1.0 or EJB1.1 specification, follow the procedure below:
1) Create a project, then import the resources
If the resources were not created using workbench, then follow the procedure below:
Create an EJB project.
Specify [2.0] in [EJB Module Version].
Import the resources using the Import wizard.
Select [File] > [Import] from the menu bar to select the import wizard, and import the necessary resources. If migrating from EJB1.0 or EJB1.1 to EJB2.0, the deployment descriptor is not imported.
2) Update deployment descriptors
The deployment descriptor generated when the project was created must be opened in an XML editor, and the XML must be directly updated. Set the required information, and update the deployment descriptor.
3) Modify the Java sources.
The source files do not need to be modified when migrating from EJB1.1 to EJB2.0. For migration from EJB1.0, modify them properly for the following processing:
Lookup processing
Business method invocation processing
UserTransaction processing
Processing of using Enterprise Bean Environment
Migration from J2EE Application Client1.3 to J2EE Application Client1.4
To migrate resources that obey J2EE Application Client1.3 to J2EE Application Client1.4, follow the procedure below:
1) Create a New Project
Create a new Application Client Project using the Application Client project wizard. In [Application Client module version], specify [1.4].
2) Import old resources using the Import wizard
Select [File] > [Import] from the menu bar to start the Import wizard. In [Select], select [General] > [File System] to import the necessary resources (source file, deployment descriptor and so on). Store the deployment descriptors to the META-INF folder in the source folder. A deployment descriptor is generated when an application client project is created. Overwrite the deployment descriptor of the existing resources at import time.
3) Update deployment descriptors
Modify the deployment descriptor from J2EE Application Client1.3 to J2EE Application Client1.4 format. The deployment descriptor must be opened in the XML Editor and modified directly.
Modify the deployment descriptor Schema definition from DTD to XML Schema.
Define the XML Schema as shown below.
J2EE Application Client1.3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN" "http://java.sun.com/dtd/application-client_1_3.dtd">
<application-client>
J2EE Application Client1.4
<?xml version="1.0" encoding="UTF-8"?> <application-client id="Application-client_ID" version="1.4" xmlns=http://java.sun.com/xml/ns/j2ee xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd"> </application-client>
Modify tag configuration
Correct tag configurations and tags for values that have changed from J2EE Application Client1.3 to J2EE Application Client1.4.
<small-icon>, <large-icon> tags
Modify icon specification tags <small-icon> and <large-icon> so that they are enclosed by <icon>tag:
J2EE Application Client1.3
<small-icon>icon/small.gif</small-icon> <large-icon>icon/large.gif</large-icon>
J2EE Application Client1.4
<icon> <small-icon>icon/small.gif</small-icon> <large-icon>icon/large.gif</large-icon> </icon>
When JSF is used in Web applications
Add libraries using the following procedure after migrating resources to use JSF in Web applications:
Select the project. From the context menu, click [Properties] > [Java Build Path] > [Libraries] tab > [Add Library].
Select [JSF Libraries] and click [Next].
Click [Add].
Enter "JSF" for the library name, click [Add], and select the following jar file.
<installation folder>\APS\F3FMisjee\lib\jsf-impl.jar
Select [Is JSF Implementation] and click [Finish].
Select the added JSF library and click [Finish].