Migrate a Version 4 data access application to Version 5
When the WebSphere Application Server migration tools migrate Version 4 applications to Version 5 applications, the resulting application is packaged as a J2EE 1.2 application. The Version 4 datasources are migrated, because the connection manager is used with the Version 5 runtime to support these applications.
To use the connection management infrastructure in WebSphere Application Server Version 5 and the J2C connection manager, package your application as a J2EE 1.3 application. Your Version 4 datasources do not work and must be replaced by Version 5 datasources, which are dependent on new Version 5 JDBC resource providers. This re-packaging requires that the Version 4 applications be re-installed as a J2EE 1.3 application and all components in that application must match the required specifications for servlets and EJBs.
Perform these steps to repackage your Web modules to the Servlet 2.3 Specification and your EJB modules to the EJB 2.0 Specification, create the JDBC provider and data source, and install the applications.
Convert a Servlet 2.2 Specification Web module to a Servlet 2.3 Specification Web module
Use the following steps to migrate each of your Web modules.
- Open the Application Assembly Tool.
- Create a new Web module by selecting File --> New --> Web Module.
- Add any required class files to the new module.
- Expand Files.
- Right-click Class Files, and select Add Files.
- In the Add Files window click Browse.
- Navigate to your Version 4 EAR file, and click Select.
- In the upper left pane of the Add Files window, navigate to your WAR file, and expand the WEB-INF --> classes directories.
- Select each of the directories and files in the classes directory and click Add.
- When you have added all of the required class files, click OK.
- Add any required JAR files to the new module.
- Expand the Files portion of the tree.
- Right click Jar Files and select Add Files.
- Navigate to your Version 4 EAR file and click Select.
- In the upper left pane of the Add Files window, navigate to your WAR file and expand the WEB-INF and lib directories.
- Select each JAR file and click Add.
- When you have added all of the required JAR files, clickOK.
- Add any required resource files, such as HTML files, JSP files, GIFs, and so on, to the new module.
- Expand the Files portion of the tree.
- Right click Resource Files and select Add Files.
- Navigate to your Version 4 EAR file and click Select.
- In the upper left pane of the Add Files window, navigate to your WAR file.
- Select each of the directories and files in the WAR, excluding META-INF and WEB-INF, and click Add.
- When you have added all of the required resource files, clickOK.
- Import your Web Components.
- Right click on Web Components and select Import.
- In the Import Components window, click Browse.
- Navigate to your Version 4 EAR file and click Open.
- In the left top pane of the Import Components window highlight the WAR file you are migrating.
- Highlight each of the components displayed in the right top pane and click Add.
- When all of your Web components show up in the Selected Components pane of the window, click OK.
- Verify that your Web components are correctly imported under the Web Components section of your new Web module.
- Add servlet mappings for each of your Web components.
- Right click Servlet Mappings and select New.
- Fill in a URL pattern for the Web component.
- Select the Web component from the Servlet drop down box.
- Click OK.
- Add any necessary resource references by following the instructions in Create or changing a resource reference .
- Add any other Web module properties that are required. Click Help for a description of the settings.
- Save the Web module.
Converting an EJB 1.1 module to an EJB 2.0 module
Use the following steps to migrate each of your EJB modules.
- Open the Application Assembly Tool.
- Create a new EJB Module by selecting File --> New --> EJB Module.
- Add any required class files to the new module.
- Right click Files object and select Add Files.
- In the Add Files window click Browse.
- Navigate to your Version 4 EAR file and click Select.
- In the upper left pane of the Add Files window, navigate to your EJB JAR file.
- Select each of the directories and class files and click Add.
- When you have added all of the required class files, click OK.
- Create your session beans and entity beans. To find help on this subject, Migrate enterprise bean code to the supported specification in the Application Development topic, the documentation for WebSphere Studio Application Developer, or the documentation for WebSphere Studio Application Developer Integration Edition.
- Add any necessary resource references by following the instructions in Create or changing a resource reference .
- Add any other EJB module properties that are required. Click Help for a description of the settings.
- Save the EJB module.
- Generate the deployed code for the EJB by selecting File --> Generate Code for Deployment.
- Fill in the appropriate fields and click Generate Now.
Add the EJB Modules and Web Modules to an EAR file
- Open the Application Assembly Tool.
- Create a new Application by selecting File --> New --> Application.
- Add each of your EJB modules.
- Right click EJB Modules and select Import.
- Navigate to your converted EJB Module and click Open.
- Click OK.
- Add each of your Web modules.
- Right click Web Modules and select Import.
- Navigate to your converted Web module and click Open.
- Fill in a Context root and click OK.
- Fill in any other application properties. Click Help for a description of the settings.
- Save the EAR file.
Install the application in WebSphere Application Server
- Create a JDBC provider and a Version 5 data source object following the instructions in JDBC resources in the Administration topic.
- Install the application, following the instructions in Install and uninstall applications in the Administration topic and bind the resource references to the data source you created.