There are all kinds of considerations when migrating an application from WAS 5.x to 6.x. But I want to talk about moving projects from WAS 5.x to WAS 6.x within Rational Application Developer. This change could come in two flavors:
- Moving from WSAD to RAD
- Moving from RAD using WAS 5.1 to WAS 6.0
Before we talk about specific steps to follow, it must be noted that every J2EE project in WSAD or RAD uses at least 2 variables. Both of these variables are predefined in the IDE and point to specific set of jar files:
- JRE System Library variable, which can be configured to point to any valid JRE. While you have the option to use the eclipse JRE that comes with the IDE, I recommend against it. The JRE System Library variable should point to WebSphere JRE because the code is ultimately going to run in WAS runtime environment.
- WebSphere v5.1 runtime, which is added by WSAD or RAD when the project was created for WAS 5.x server. This variable includes all the J2EE and WebSphere libraries needed to build the project
In any case you can follow these steps to move the project:
- If the project doesxxn't exist in RAD already, import it using File > Import > Existing Project into Workspace, select the directory that contains the .project file and click Finish
- Upon successful import, one or more of the following could happen:
- If you are using RAD and if you have installed WAS 5.x test environment, you should not get any errors. To use WAS 6.x runtime in this case,
- Right click the project, select Properties > Java Build Path > Libraries tab
- Select JRE System Library variable and click Edit button
- Click Alternate JRE radio button, select WebSphere v6 JRE from the dropdown and click Finish
- Go to the Server section in the Properties dialog box and select WebSphere Application Server v6.0 in the Target runtime dropdown
- Click OK to close the Properties dialog box, the project should rebuild itself
- If you haven't installed WAS 5.x test environment, you will get errors upon importing a project that has WAS 5.x entries in its classpath. In that case,
If any of your projects had generated EJB code, you will get a number of compilation errors that won't make much sense, just delete all the generated code and do a clean build. If you will start using JDK 1.4 with this move and have assert statements in your code, there are some other considerations
- Right click the project, select Properties > Java Build Path > Libraries tab
- If the JRE System Library variable has an error, remove it
- Click Add Library button, select JRE System Library click Next
- Click Alternate JRE radio button, select WebSphere v6 JRE from the dropdown and click Finish
- Remove the WebSphere v5.1 runtime entry
- Go to the Server section in the Properties dialog box and select WebSphere Application Server v6.0 in the Target runtime dropdown
- Click OK to close the Properties dialog box, the project should rebuild itself
0 comments:
Post a Comment