Server targeting issues and considerations

This topic provides additional migration issues that relate to targeting WebSphere® Application Server and WebSphere Portal servers.

Resetting the target server in Version 5.1.2 or 6.x

Before migrating your project to V7.1 from V5.1.2 or V6.x, you should set the target server; otherwise the project may not compile and you will see errors. (For example, an "unbound classpath" error).

To reset the target server on J2EE projects in V6.x:
  1. Click on the project and select Properties.
  2. Click Server in the list of properties.
  3. For Target Runtime, select the appropriate target runtime for the project. (for example, WebSphere Application Server V6.1).
  4. Click Apply, and then click OK.
To reset the target server on J2EE projects in V5.1.2:
  1. Open the .classpath file for each J2EE project that has a .classpath file.
  2. Delete the following classpath entries from the .classpath file and save and close the file.
    • <classpathentry kind="con"
      path="org.eclipse.jdt.launching.JRE_CONTAINER/
      org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/WebSphere v5.1 JRE"/>
    • <classpathentry kind="con"
      path="com.ibm.wtp.server.java.core.container/
      com.ibm.etools.websphere.runtime.core.runtimeTarget.v51/was.base.v51"/>
  3. Make sure server targeting support is enabled in the J2EE preferences page. Select Window > Preferences > J2EE and confirm that Enable server targeting support is selected under "Server Targeting Support."
  4. Right-click on the project and select either:
    • Properties > Web, or
    • Properties > J2EE
  5. Select the corresponding target server for the runtime target on the project (for example, WebSphere Application Server V5.1 using the JDK 1.4 runtime environment) and click OK.

Retargeting the server for Portal projects or Web projects in Version 7.1

Note: It is highly recommended that you set a target server for your project in the previous release before migrating as described in Resetting the target server in Version 5.1.2 or 6.x above. If you no longer have the previous release installed the steps below may help in resolving common problems.

To migrate a V5.1.2x Portlet project, you will need to reset the target server after importing the project into V7.1. Similar action is required for V5.1.2x Web projects which have already been moved into V7.1 without first setting a target runtime. These steps are necessary to resolve build errors due to incorrect JARs and class folders on the build path.

To remove the build errors:
  1. In the Navigator view or Project Explorer view, select the project imported. Right-click, then select Properties. The Properties window opens.
  2. On the left-hand side of the Properties window, click Java Build Path.
  3. On the right-hand side of the Properties window in the Java Build Path pane, click the Libraries tab.
  4. For each build path entry that is missing indicated by a warning icon, select the entry (for example, SERVERJDK_50_PLUGINDIR/jre/lib/rt.jar) and click Remove.

    Click OK to close the Properties window.

To set a target runtime:
  1. In the Navigator view or Project Explorer view, select the project. Right-click, then select Properties. The Properties window opens.
  2. On the left-hand side of the Properties window, click Targeted Runtimes.
  3. On the right-hand side of the Properties window in the Targeted Runtimes pane, clear all check boxes, then click Apply.
  4. In the Targeted Runtimes pane, select your desired runtime, then click Apply
    Note: If the runtime you have chosen shares JARs with those already on the build path, you may need to manually remove any duplicates. If this is the case, an error dialog will appear with the message "Failed while Dynamic Web Module 2.3 was reacting to changed runtime." Click the Details button to see which build path entry is a duplicate, then remove it from the Java Build Path property as previously described. Repeat steps 1-4 as necessary until no more duplicates are reported.

Feedback