application migration tool for websphere version...

48
WebSphere Application Server Application Migration Tool for WebSphere Version Migration Built on Rational Software Analyzer technology Version 3.5.3 A combined effort: IBM Software Group, Application and Integration Middleware Software IBM Software Group, Rational Software © Copyright IBM Corp. 2009, 2013

Upload: others

Post on 29-Aug-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

WebSphere Application Server

Application Migration Tool forWebSphere Version Migration

Built on Rational Software Analyzer technology

Version 3.5.3

A combined effort:

IBM Software Group, Application and Integration Middleware SoftwareIBM Software Group, Rational Software

© Copyright IBM Corp. 2009, 2013

Page 2: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

2 | Contents

Contents

Overview................................................................................................................................ 3New for this release...............................................................................................................4

Version 3.5.3............................................................................................................................................ 4Support...................................................................................................................................5Installing and updating the migration tools....................................................................... 6Importing applications....................................................................................................... 10

Shared Java projects............................................................................................................................... 11EAR-level library....................................................................................................................... 11Web module library....................................................................................................................11

Configuring a Java EE Runtime Library................................................................................................11Configuring the migration tool for analysis..................................................................... 14Analyzing code for migration............................................................................................ 19Running additional rules to optimize code quality.......................................................... 21WebSphere Application Developer Tools for Eclipse......................................................22WebSphere Application Server version migration rules and quick fixes......................23

Java code review.................................................................................................................................... 23JSP code review..................................................................................................................................... 27XML code review...................................................................................................................................28Deprecated features................................................................................................................................ 30

Java SE version migration................................................................................................. 39Troubleshooting.................................................................................................................. 44

Software Analyzer options not shown................................................................................................... 44Java EE constructs or JSP not read correctly......................................................................................... 44Logging and trace...................................................................................................................................44Reports and history.................................................................................................................................45Markers...................................................................................................................................................45Known issues..........................................................................................................................................45

Copyright and trademarks.................................................................................................48

Page 3: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Overview | 3

Overview

The Application Migration Tool - WebSphere Version to Version feature is part of the IBM® WebSphere® ApplicationServer Migration Toolkit. This toolkit is one part of the overall strategy for migrating from one version of IBMWebSphere Application Server to another version. The Application Migration Tool - WebSphere Version to Versionfeature provides support for migrating applications from older versions of WebSphere Application Server to WebSphereApplication Server Version 7.0, 8.0, or 8.5.

The overall migration process between versions of WebSphere Application Server involves a series of steps to assess themigration, plan the work involved, migrate and develop the code, manage the runtime configuration, test the results, androll out the new release. This tool helps migrate and develop the code.

There are a number of issues that affect the code migration and development step when moving between WebSphereApplication Server releases. These include:

• Changes to the Java™ Runtime Environment (JRE) encountered in Java SE 5, 6 and 7• Removal of previously deprecated features• Behavior changes in the product APIs• Changes resulting from Java Enterprise Edition (Java EE) specification clarifications• Deprecated features

The migration process can involve modifying Java source code, JavaServer Pages (JSP), and deployment descriptors. Theapplication migration tool can assist you in performing these types of code changes.

This document explains how to install, configure, and use the tool to assist in the conversion process. The migrationtool is based on IBM Rational® Software Analyzer, which provides a single solution to identify, analyze, and optimizethe application health. The migration tool uses the scanning capabilities of Rational Software Analyzer to look forspecific constructs that have changed between versions of WebSphere Application Server that can affect compilation andapplication server runtime behaviors. The tool then provides a way to review problematic code, get help on the issue, andin some cases make automatic fixes to the code so that the application can run on IBM WebSphere Application ServerVersion 7.0, 8.0, or 8.5.

For WebSphere Application Server version migration, the tool supports migrating from:

• WebSphere Application Server Version 5.1• WebSphere Application Server Version 6.0• WebSphere Application Server Version 6.1• WebSphere Application Server Version 7.0• WebSphere Application Server Version 8.0

and migrating to:

• WebSphere Application Server Version 7.0• WebSphere Application Server Version 8.0• WebSphere Application Server Version 8.5

The IBM WebSphere Application Server Migration Toolkit developerWorks site provides information on version-to-version application migration, application migration from a third-party application server, and configuration migration. Seethe Application Migration Tools for Competitive Migration documentation for information about migrating from a third-party application server to WebSphere Application Server.

See the WebSphere Application Server V8.5 Migration Guide for comprehensive information on WebSphere ApplicationServer migration topics such as the Application Migration Toolkit. Part 4 of the guide covers migrating from earlierversions of WebSphere Application Server.

Page 4: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

4 | New for this release

New for this release

Version 3.5.3

Application Migration Tool - WebSphere Version to Version V3.5.3 adds the following rules.

• Check for a behavior change in JAX-WS dynamic port memory requirements - for WebSphere Application ServerVersion 7.0 and later

• Do not use Java keywords in JSP and JSF expression language elements - for WebSphere Application Server Version8.0 and later

• Detect validation.xml files - for WebSphere Application Server Version 8.0 and later

Support

Bug and field support fixes have been added to this release.

• Improvements were made to the Do not redefine a taglib prefix using a different URI rule. The rule did not flag allissues within the context of the JSP file and its included JSP fragments.

The application migration tool now supports Eclipse 4.3.

Page 5: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Support | 5

Support

The application migration tool scans for a number of known issues in applications being migrated from WebSphereApplication Server Version 5.1, 6.0, 6.1, 7.0, or 8.0 to WebSphere Application Server Version 7.0, 8.0, or 8.5. Wherepossible, a quick fix is provided to change your code to address the changes between versions. Supported migration rulesand quick fixes are documented in the section WebSphere Application Server version migration rules and quick fixes onpage 23. As new rules and quick fixes are available, updates are made available on developerWorks®.

You can use the quick fix preview support in the migration tool to help you decide if you want to accept the suggestedcode change. Also, view the help information provided with the rules to decide if you want to run the quick fix. Alwaysmake a backup copy of your source code before you start a migration.

For some rules, the scan detects code that requires design changes and code rewrites. The tool highlights these problemareas but does not provide a quick fix.

The tool does not identify all problems. As you encounter problems that the tool does not flag, provide feedback throughthe Application Migration Tool forum, which is available at http://www.ibm.com/developerworks/forums/forum.jspa?forumID=2106. You can also use the forum to get answers to your questions about the tool.

If you have access to IBM Passport Advantage®, you can open a customer problem report. Other users can use theApplication Migration Tool forum to report issues or suggestions and ask questions.

The Application Migration Tools are supported on the Windows and Linux operating systems as supported by Eclipse andRational Application Developer.

Page 6: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

6 | Installing and updating the migration tools

Installing and updating the migration tools

The application migration tools are Eclipse features that you install into an existing Eclipse or Rational developmentenvironment. Supported platforms include:

• Eclipse 3.6.2, 3.7, 4.2, and 4.3• Rational Application Developer versions 7.5 to 9.0• Rational Software Architect versions 7.5 to 8.5

You can download Eclipse from http://www.eclipse.org. Eclipse IDE for Java EE Developers is recommended for workingwith Java EE applications.

You can install the version migration tool directly from Eclipse Marketplace or manually download the repository archive.Both options are described in the following steps:

1. Start the IDE.

2. Uninstall any migration tool beta versions or versions older than V2.1.

3. In Rational Application Developer, all prerequisite plug-ins are typically installed by default. In Rational SoftwareArchitect, the plug-ins are not enabled by default. Use IBM Installation Manager to verify that the BusinessIntelligence and Reporting Tools and the Web Developer Tools features are installed in your Rational product.

If you are using an Eclipse environment, verify that the prerequisite plug-ins for your particular Eclipse version areinstalled.

Eclipse version Install actions

Eclipse 4.3 • From the Eclipse menu bar, select Help > Install New Software.• Using the Kepler update site (http://download.eclipse.org/releases/kepler),

install the BIRT Framework listed in the Business Intelligence, Reportingand Charting feature. Also install Web, XML and Java EE Development.

Eclipse 4.2 • From the Eclipse menu bar, select Help > Install New Software.• Using the Juno update site (http://download.eclipse.org/releases/juno), install

the BIRT Framework listed in the Business Intelligence, Reporting andCharting feature. Also install Web, XML and Java EE Development.

Eclipse 3.7 • From the Eclipse menu bar, select Help > Install New Software.• Using the Indigo update site (http://download.eclipse.org/releases/indigo),

install the BIRT Framework listed in the Business Intelligence, Reportingand Charting feature. Also install Web, XML and Java EE Development.

Eclipse 3.6 • From the Eclipse menu bar, select Help > Install New Software.• Using the Helios update site (http://download.eclipse.org/releases/helios),

install the BIRT Framework listed in the Business Intelligence, Reportingand Charting feature. Also install Web, XML and Java EE Development.

Note: The catalog of available plug-ins is large and might require several minutes to download.

Page 7: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Installing and updating the migration tools | 7

Figure 1: Eclipse 4.2 plug-in installation dialog4. Set up the version migration tool.

In Eclipse, you can install the tool directly from Eclipse Marketplace. If you are using Rational Application Developeror do not have Eclipse Marketplace, you can manually download and install the repository archive.

• To install the tool from the Eclipse Marketplace:

1. Go to Help > Eclipse Marketplace.2. Search for WebSphere migration.3. Under IBM WebSphere Application Server Migration Toolkit, click Install.

Figure 2: Eclipse Marketplace dialog• To download and install the repository archive:

1. Download the latest version of Application Migration Tool - WebSphere Version to Version from thedeveloperWorks site http://www.ibm.com/developerworks/websphere/downloads/migtoolkit/vtov.html, and saveit locally.

2. Go to Help > Install New Software to open the installation dialog to install or update the ApplicationMigration Toolkit.

Page 8: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

8 | Installing and updating the migration tools

3. Click Add to point to your downloaded update site file.4. In the Add Repository window, enter the following information, as shown in Figure 3: Adding a repository.

• Name: Application Migration Tool• Location: Click Archive and find the compressed file that you downloaded.

Figure 3: Adding a repository5. Click OK.

5. Complete the following actions in the Install window, as shown in Figure 4: Select plug-in.

a) Select Application Migration Tool, which selects both the main feature and the other included features. The otherincluded features are the common feature, the JRE feature, and the framework feature. It is particularly important tohave the common feature included when upgrading.

b) Select Contact all update sites during install to find required software, and click Next.

Note: If you are installing the tool on Rational Application Developer 7.5, it is preferable to not select Uncategorizedfrom the repository site. These plug-ins will be installed automatically regardless of the selection. If Uncategorized isselected, the plug-ins will not be automatically uninstalled if you uninstall the application migration tool.

Page 9: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Installing and updating the migration tools | 9

Figure 4: Select plug-in6. Click Next on the Install Details panel.

7. On the Review Licenses panel, read the terms and accept any license agreements. Click Finish. The install statuswindow shows the installation progress.

8. Restart the IDE when the Software Updates window is displayed.

Figure 5: Restart dialog

Page 10: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

10 | Importing applications

Importing applications

To analyze an application for migration, the application must be imported into your Eclipse-based IDE. In order toeffectively and completely analyze the application, the application modules must be organized in projects that reflect theirstructure as EAR, WAR, and EJB files. Specifically, migration rules that analyze web and EJB bindings and extensionsonly work when analyzing projects created as dynamic web projects and EJB projects.

To achieve this, you can either import your existing EAR, web archive (WAR), and Enterprise JavaBeans (EJB) modulesor manually create new projects in the workspace for each EAR, WAR module, and EJB module. You can use the ImportEclipse options to create the correct project structure. Rational Application Developer or the Eclipse for Java EE developertools are needed to create these projects properly.

For example, to import an EAR file, select the File > Import menu option. Select Java EE then EAR file to enter thelocation of your EAR file. The Eclipse import function will create a project for the EAR file and a project for each modulein the application.

Figure 6: Importing an EAR file

By importing the application, the proper project structure is created with the deployment descriptor information. If yourEAR file contains source code, it will also get imported into the Eclipse project. However, most EAR and module files donot contain the Java source code, and you need to copy the source code to its correct source folders. Again, use the File> Import options to import the source code from the file system or from an archive (zip) file. Repeat this procedure toimport the source code for each module.

When creating projects manually, create the EAR file using File > New > Enterprise Application Project option. Createeach WAR file using the File > New > Dynamic Web Project option, and create each EJB module using the File > New> EJB Project option. Copy the source files to their correct locations in the project using the File > Import options.

Review the following guidelines for structuring projects:

• Java source code for a WAR file (for example, servlet, model, or utility classes), belongs in the src folder of theproject. The src folder is defined and can be changed in the Java Build Path properties for the project. If the Javasource code needs to be referenced by more than one WAR file, see the Shared Java Projects section of this document.

• Java source code for an EJB module can be placed in the ejbModule folder of the EJB project.• Precompiled Java archive (JAR) libraries for a WAR file belong in the WebContent/WEB-INF/lib folder.• EAR-level JAR libraries can be placed in the EarContent folder of the enterprise application project. If your project

contains an APP-INF/lib folder, it can be placed in the EarContent folder; however, you must run the class pathrule and its quick fix to update the class paths correctly.

Page 11: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Importing applications | 11

For a more detailed description of how to import applications, see the WebSphere Application Server V8.5 MigrationGuide (http://www.redbooks.ibm.com/redbooks/pdfs/sg248048.pdf).

Shared Java projects

There are two options for referencing shared Java classes from a web project:1. Create a single copy of the Java project JAR file in the EAR file. Each WAR file references the JAR file. This approach

reduces the size of the EAR file.2. Create a copy of the JAR file in each WAR file. Use this approach if only one WAR file references the JAR file.For more information on configuring the deployment assembly, refer to Java EE Deployment Assembly.

EAR-level library

Complete the following steps to place Java source files in a separate project:1. Create a new Java project and add the Java source into the src folder of the project.2. Right-click the project in the Project view and select Properties. Select the Deployment Assembly item from the left

pane. On the right pane, click Add to include the Java projects you want to reference.

Figure 7: Java EE EAR module dependencies

Web module library

To create a copy of the JAR file in each WAR file, complete the following steps:1. Open the Properties dialog of the web project.2. Right-click the project in the Project view and select Properties. Select the Deployment Assembly item from the left

pane to view the Web Deployment Assembly. On the right pane, click Add to include the Java projects or archives youwant to reference.

3. Click OK to save your changes.

Configuring a Java EE Runtime Library

If you are using Eclipse with the Java EE tools installed, the Java compiler is not able to resolve references to the Java EEAPIs unless a target Java EE runtime environment is configured.

Follow these steps to configure the Java EE Runtime Library:1. Open the Eclipse preferences by choosing Preferences under the Eclipse Window menu.2. Navigate to the Server > Runtime Environments item on the left pane.

Page 12: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

12 | Importing applications

Figure 8: Server Runtime Environments3. Click Add. Select Basic > J2EE Runtime Library.

4. On the next wizard page, click Browse to choose the library location, locate the dev/JavaEE folder of yourWebSphere Application Server installation, and select the appropriate Java EE version. That folder contains thej2ee.jar file with the Java EE APIs.

To use this runtime library in a web or EJB project, go to the project properties dialog. Right-click the project in theProject view, select Properties, and choose the Targeted Runtimes item.

Page 13: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Importing applications | 13

Figure 9: Targeted Runtimes

In the Targeted Runtimes window, select the check box next to the recently configured Java EE runtime library, and clickOK.

You can achieve the same effect by targeting WebSphere Application Servers and the Liberty Profile when you have theWebSphere Application Server Developer Tools installed.

Page 14: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

14 | Configuring the migration tool for analysis

Configuring the migration tool for analysis

You can configure the tool to define a set of rules to run and define the scope of analysis within the workspace. Thescope can be a project, a working set, or the entire workspace. After you define the scope, you can save the analysisconfiguration to use or modify later. With a migration tool installed, you have new analysis options to configure and run ananalysis. You can access the options in the Eclipse Run menu, in the Launch toolbar, and in the explorer pop-up menus.The following figure demonstrates the different ways you can run the analysis using the application migration tools.

From the Launch Eclipse toolbar: From the Eclipse menu:

From the explorer pop-up menu:

Figure 10: Options for running the tool

If you do not see Software Analyzer options, see Software Analyzer options not shown on page 44.

To configure the analysis using the toolbar, complete the following steps:

1. On the toolbar, select Software Analyzer ( ) > Software Analyzer Configurations to display the mainconfiguration dialog.

You can add or remove analysis configurations by using the icons in the dialog.

Page 15: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Configuring the migration tool for analysis | 15

Figure 11: Creating a new Software Analyzer configuration2. In the configurations list, select Software Analyzer. Then, click New . The right side of the dialog changes to show

the basic configuration interface.

Page 16: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

16 | Configuring the migration tool for analysis

Figure 12: Setting up the configuration3. In the Software Analyzer Configurations dialog, enter a name for the configuration, such as “AppMigration”.

4. On the Scope tab, select Analyze entire workspace to scan all projects in the workspace.

You can limit the scope of an analysis by using the other options on this dialog to analyze a working set or a selectionof projects.

Tip: When you use the explorer pop-up menu to run your analysis, the scope of the analysis is limited to the node inthe project where the menu item was selected. This allows you to perform a quick analysis on a limited set of code.

5. On the Rules tab, select the type of analysis to perform using the Rule Sets list. You can also select individual rules torun.

Tip: To obtain additional information about a rule, highlight the rule and press F1 (Shift-F1 for Linux). Help forthe rule is shown in the configuration dialog. The initial help page includes a short description and a link to moreinformation.

Page 17: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Configuring the migration tool for analysis | 17

Figure 13: Selecting rules

Rules that analyze version-to-version migration changes are included under the WebSphere Application Serverversion migration rule set.

The version migration tool has rules under the following analysis providers:

• Java Code Review• JSP Code Review• XML File Review

After you select a rule set, click Set to select the applicable application migration rules.

Figure 14: Configuring a rule set

Page 18: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Select the target WebSphere Application Server version and the source Java version. If the target WebSphereApplication Server version is V8.5, you can also select the target Java version, Java 6 or Java 7. Select Final target is aLiberty profile server running on Oracle Java only if you are not using an IBM-supplied Java Runtime Environmentwith the Liberty profile server.

Note: The number of rules in the analysis configuration dialog varies depending on the platform on which the tool isinstalled. Analysis rules are available in several Rational products such as Rational Application Developer; therefore,the included rule sets might be different.

6. To save the rule configuration, click Apply.

7. You can use the Software Analysis Configurations dialog to select or clear any rule or group of rules to use in theanalysis. For example, if you find after analysis that you do not need to make changes pointed out by a particular rulefrom the selected rule set, you can clear its selection to turn it off.

a) To find the rule, the navigation in the configuration dialog is similar to the folders shown in the results tree view.Use the folder names to locate the rule.

b) Clear the rule selection.c) Click the Apply button.d) Click the Analyze button.

The deselected rule will not be included in the next analysis.

Page 19: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Analyzing code for migration | 19

Analyzing code for migration

Run the analysis and display the results.

To start the analysis, click Analyze on the Configuration dialog.

The results are displayed in the Software Analysis Results view.

Figure 15: Java Code Review results view

Depending on which rules you are running, the content of the results view might vary. The results generated by amigration tool are displayed in one of the following tabs:

• Java Code Review• JSP Code Review• XML File Review

If no results are shown in the panel, no issues were identified while scanning.

Right-click individual results to show the available options such as viewing the source code where the problem occurred orcorrecting the problem with a provided fix.

Page 20: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Figure 16: Result options with Quick Fix Preview and Help

Not all rules have all actions available, but the possible actions include:

• View Result - Opens an editor showing the source file that triggered the rule. The cause ofthe problem is highlighted, and a rule violation icon is shown in the left margin of the editor.

•Quick Fix - The light bulb overlay on the result list icon ( ) indicates that this rule has a quick fix. Selecting thisoption runs the conversion that modifies the affected Java code, XML file, JSP or manifest file, allowing it to run inWebSphere Application Server. The quick fix might change the code directly or it might present the steps needed tocomplete the fix.

• Quick Fix Preview - This option is available for the rules that support showing a side-by-side comparison of theoriginal code and the code after the quick fix is applied. This option allows you to see the changes before they aremade.

• Ignore Result - This option removes the rule from the list without making a code change. For Java and XML files, acomment annotation is added to the file so that the rule is not triggered on future analysis runs.

• Quick Fix All - This option resolves all issues identified for a given rule.• Quick Fix All Category - This option runs all quick fixes identified for the category to which the rule belongs. A

rule must have Quick Fix All enabled for the Quick Fix All Category option to run its quick fix. For example, if youchoose this option on a Java rule, the quick fixes for all Java rules that have the Quick Fix All option are run.

Context-sensitive help is displayed in the Help view as you select each result. The first panel is a short description. ClickDetailed Help to get more information. Press F1 to open the Help view if it is not already displayed.

Page 21: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Running additional rules to optimize code quality | 21

Running additional rules to optimize code quality

After you successfully migrate your application, Rational Software Analyzer provides additional rules that can helpimprove the quality of your code. Figure 17: Other architectural and Java rules shows examples of the additional rules.

Figure 17: Other architectural and Java rules

Access these rules by creating a new analysis configuration or modifying an existing one. These rules are not automaticallyselected as part of rule sets for the application migration tools.

When the selected rules are run and necessary changes are made, the updated application must be exported and tested onWebSphere Application Server. If you use Rational Application Developer, tools are available to create deployments andtest the application within the Rational Application Developer environment.

Some uses have found the Avoid using com.ibm.ws.* package rule in the Java Code Review > Private API > WebSpherecategory helpful during migration analysis. The com.ibm.ws.* package contains application-server-internal APIs that arenot for application use and are subject to change. If you know your application uses private APIs or if you are not sure, youcan use this rule to check your application. If you have generated code related to EJBs or web services, you might get falsehits on this rule.

Page 22: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

22 | WebSphere Application Developer Tools for Eclipse

WebSphere Application Developer Tools for Eclipse

If you are using the Eclipse IDE for application development, there are a number of tools available that can be used withthe migration toolkit that enable you to migrate, develop, deploy, and test within a single lightweight Eclipse IDE. Toolsare available for both the traditional WebSphere Application Server and the new Liberty profile server.

• IBM WebSphere Application Server v8.5 Liberty Profile Developer Tools• IBM WebSphere Application Server v8.5 Developer Tools• IBM WebSphere Application Server v8.0 Developer Tools• IBM WebSphere Application Server v7.0 Developer Tools

These tools are available from the Eclipse Marketplace and can be installed easily from within Eclipse:

1. Start your Eclipse workbench.2. Click Help > Check for Updates to install the latest updates.3. Click Help > Eclipse Marketplace.4. In the Find field, type WebSphere.5. In the list of results, locate the appropriate WebSphere Application Server Developer Tools and then click Install.

The tools provide function and features for the capabilities of their targeted release of WebSphere. They also containfunctionality for managing the server, publishing to a local or remote server, and for controlling incremental publishing.For general discussion, demos, and information links, go to http://wasdev.net for more information.

The Liberty profile provides a simplified application server runtime environment that makes testing web applications mucheasier for the developer. The corresponding WebSphere Application Server V8.5 Liberty Profile Developer Tools supportthe development, assembly, and deployment of web applications to servers based on the WebSphere Application ServerV8.5 Liberty profile server. To get started with the Liberty profile server, see The Liberty profile. Also see, Liberty profile:Feature management to understand the Liberty profile server supported features and capabilities.

Page 23: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

WebSphere Application Server version migration rules and quick fixes | 23

WebSphere Application Server version migration rulesand quick fixes

The Application Migration Tool - WebSphere Version to Version feature evaluates Java code, JSP code and deploymentdescriptors as part of its analysis set. This section provides specific details on the rules and quick fixes that are provided.

WebSphere Application Server conversion rules are included in the following analysis domains:

Figure 18: Analysis domains

Java code review

Under the Java Code Review set of rules, the WebSphere version migration category contains rules for migrating fromWebSphere Application Server Version 5.1, 6.0, 6.1, 7.0, and 8.0 to Version 7.0, 8.0, or 8.5. For more information on arule, press F1 when viewing the rule in the configuration dialog or in the results viewer.

Quick fixes are available where possible. Rules without quick fixes flag the rule violations so you can evaluate their usageand migrate the code manually.

Table 1: V5.1 to V6.0 migration

Rule Name QuickFix

Action Taken

Check for a behavior change on theServletResponse default content type

No The default content type for HttpServletResponse haschanged from "text/html" to "text/plain" for servlets that do notset the content type.

Check for behavior change on URLscontaining a plus sign

No This rule flags calls in Java code that create Uniform ResourceLocators (URL) that contain a plus ("+") character in the URIthat is not part of the query parameters. The plus ("+") is onlyreserved in the query string portion of the URL.

Check for expected behavior onServletResponse sendRedirect() method

No The WebSphere Application Server implementation of theServletResponse sendRedirect() method omits pathinformation until the last slash. With a new custom propertythis behavior can be corrected.

Do not start threads from code runningwithin the web container

No A restriction was added in WebSphere Application Server V6.0that code running in the web container is no longer allowed tostart threads.

Use the work manager to schedule asynchronous beans insteadof creating new threads.

Page 24: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

24 | WebSphere Application Server version migration rules and quick fixes

Rule Name QuickFix

Action Taken

Use leading slash onServletContext getResource() andgetResourceAsStream() requests

No This rule flags calls to theServletContext.getResource() andServletContext.getResourceAsStream() methodswhere it cannot easily be determined if the String value passedon the method contains a leading slash (/) as required by theservlet specification.

Do not use activity component featuresthat were removed

No This rule flags the use of the activity component classes andinterfaces that were removed in WebSphere Application ServerV6.0.

Do not use Ant task features that wereremoved

No This rule flags the use of the Ant task classes and interfaces thatwere removed in WebSphere Application Server V6.0.

Do not use asynchronous bean featuresthat were removed

No This rule flags the use of the asynchronous bean classes andinterfaces that were removed in WebSphere Application ServerV6.0.

Do not use object pool features that wereremoved

No This rule flags the use of the object pool classes that wereremoved in WebSphere Application Server V6.0.

Do not use RAS features that wereremoved

No This rule flags the use of the RAS classes and interfaces thatwere removed in WebSphere Application Server V6.0.

Do not use scheduler features that wereremoved

No This rule flags the use of the scheduler classes and interfacesthat were removed in WebSphere Application Server V6.0.

Do not use security features that wereremoved

No This rule flags the use of the security classes and interfaces thatwere removed in WebSphere Application Server V6.0.

Do not use the EarUtils class that wasremoved

No This rule flags the use of the EarUtils class that wasremoved in WebSphere Application Server V6.0.

Do not use setJMSPriority() method thatwas removed

No This rule flags the use of the method,setJMSPriority, from the interface,com.ibm.websphere.scheduler.MessageTaskInfo.This method was deprecated in the Websphere ApplicationServer V6.0 release and was replaced by the methodgetJMSPriority.

Do not use user profile features that wereremoved

No This rule flags the use of the user profile classes and interfacesthat were removed in WebSphere Application Server V6.0.

Table 2: V6.0 to V6.1 migration

Rule Name QuickFix

Action Taken

Check for behavior change onEJBContext.setRollbackOnly() method

No A call to setRollbackOnly under a certain scenario canyield a different result on WebSphere Application Serverreleases prior to V6.0.2.

Page 25: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

WebSphere Application Server version migration rules and quick fixes | 25

Rule Name QuickFix

Action Taken

Do not use Common ConnectorFramework features that were removed

No This rule flags the use of the Common Connector FrameworkAPI packages that were removed in WebSphere ApplicationServer V6.1.

Do not use the WebSphere AntStopServer.setHost() method that wasremoved

No This rule flags the use of the removedmethod setHost(String s) in thecom.ibm.websphere.ant.tasks.StopServer class.

Use the open-source JDOMimplementation to replace the JDOMfeatures that were removed

No This rule flags the use of the JDOM packages that wereremoved in WebSphere Application Server V6.1.

Use the open-source Mozilla Rhinoimplementation to replace the Rhinofeatures that were removed

No This rule flags the use of the Rhino packages that were removedin WebSphere Application Server V6.1.

Use the UserRegistry interface to replacethe CustomRegistry interface that wasremoved

No This rule flags the use of the CustomRegistry interface thatwas removed in WebSphere Application Server V6.1.

Table 3: V6.1 to V7.0 migration

Rule Name QuickFix

Action Taken

Check for a behavior change in JAX-WSdynamic port memory requirements

No This rule flags the use of JAX-WS dynamic ports that arecreated using the javax.xml.ws.Service addPortmethod. This behavior change can increase memoryrequirements.

Check the JAXB context factoryinitialization class

No This rule flags the JAXBContext newInstance()method because the context factory method has changed sinceearlier versions of JAXB.

Only use JAX-WS annotations in JavaEE 5 or later

No This rule detects the use of JAX-WS annotations in enterpriseprojects earlier than Java EE 5.

Do not use the DistributedLockingMapinterface that was removed

No This rule flags the removedcom.ibm.websphere.cache.DistributedLockingMap interface.

Do not use the InvalidationEvent orChangeEvent constructors that wereremoved

No This rule flags the use of theremoved constructors in the classescom.ibm.websphere.cache.InvalidationEvent orcom.ibm.websphere.cache.ChangeEvent. The newconstructor takes an additional field.

Do not use theSequeLinkDataStoreHelper class thatwas removed

No This rule flags the use of thecom.ibm.websphere.rsadapter.SequeLinkDataStoreHelper class.

Do not use the WebSphereUserTransactionWrapper class that wasremoved

No Do not use thecom.ibm.websphere.servlet.session.UserTransactionWrapper class because it has been

Page 26: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

26 | WebSphere Application Server version migration rules and quick fixes

Rule Name QuickFix

Action Taken

removed. Store a UserTransaction directly into the HTTPsession without wrapping it in the removed class.

Do not use theWSConnectJDBCDataStoreHelper classthat was removed

No This rule flags the use of thecom.ibm.websphere.rsadapter.WSConnectJDBCDataStoreHelper classand the com.ibm.websphere.rsadapter.DataStoreHelper.WSCONNECTJDBC_HELPER field thatwere removed.

Do not use web services gatewaycustomization APIs that were removed

No Do not use web services Customization APIs. The rule flags theuse of the com.ibm.wsgw.beans.* package.

Use Java EE servlet filters instead ofWebSphere Servlet filter class that wereremoved

No Do not use com.ibm.websphere.servlet.filterclasses because they were removed. Use javax.servlet.filterclasses instead.

Use the ConnectJDBCDataStoreHelperclass instead ofDataDirectDataStoreHelper class

Yes Do not use the com.ibm.websphere.rsadapter.DataDirectDataStoreHelper object because it wasremoved.

The quick fix changes the code to usecom.ibm.websphere.rsadapter.ConnectJDBCDataStoreHelper instead.

Use MicrosoftSQLServerDataStorehelper class instead of theMSSQLDataStoreHelper class

Yes Do not use the com.ibm.websphere.rsadapter.MSSQLDataStoreHelper class because it was removed.

The quick fix changes the code to usecom.ibm.websphere.rsadapter.MicrosoftSQLServerDataStoreHelper instead.

Table 4: V7.0 to V8.0 migration

Rule Name QuickFix

Action Taken

Check for a behavior change for EJBpresence in a web module

No This rule flags EJB annotations in Java files if these files are ina web module with version 2.5 or higher.

Check for a behavior change inApplicationException inheritance

No This rule flags the EJB ApplicationExceptionannotation which does not have the attribute inherited set.The inherited attribute was added in EJB 3.1 and changeddefault behavior of EJB 3.0 applications.

Check for a behavior change in SOAPAction set on outbound messages

No This rule flags JAX-WS Dispatch client applications that mayexperience a behavior change in the SOAP Action setting onoutbound messages.

Check for a behavior change inSOAPMessage methods

No This rule flags calls to the SOAPMessage methodsgetSOAPHeader() and getSOAPBody() that now throw anexception rather than returning null if the respective header orbody is not present.

Page 27: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

WebSphere Application Server version migration rules and quick fixes | 27

Rule Name QuickFix

Action Taken

Check for a behavior change in webservices SOAP fault codes and strings

No This rule flags applications that retrieves JAX-WS and JAX-RPC SOAP fault codes and strings because some of the contentchanged in Version 8.0.

Check for a behavior change onEntityManager refresh(Object entity)method

No This rule flags the EntityManager.refresh() methodbecause the behavior of this method has changed.

Check for a behavior change onOpenJPAEntityManager detach(T pc)method

Yes This rule flags the OpenJPAEntityManager detach(Tpc) method. The method return type changed to support the2.0 JPA specification.

The quick fix changes the detach() method todetachCopy().

Check for a behavior change onSipFactory methods

No This rule flags certain SipFactory methods using a Stringto, from, or addr parameter for which there is a behaviorchange.

Check for a behavior change on someServer MBean operations

No This rule flags the use of changed Server MBean operationsgetComponentVersion, getEFixVersion,getPTFVersion, getExtensionVersion,getVersionsForAllComponents, andgetVersionsForAllEFixesstartTransports.

Do not use the removed Apache SOAPAPI

No This rule flags the use of the removed classes in theorg.apache.soap and com.ibm.soap packages.

Do not use the removed methodgetCause() from ServletErrorReport

No This rule flags the removed getCause() method inthe com.ibm.websphere.servlet.error.ServletErrorReport class.

Use the Oracle 11g helper instead ofearlier versions

Yes This rule flags the use of the Oracle 10g helpers and fields.Version 8.0 only supports the Oracle 11g JDBC driver andhelper.

The quick fix changes the code to use the Oracle 11g helperafter confirming that the runtime configuration was changed.

Table 5: V8.0 to V8.5 migration

Rule Name QuickFix

Action Taken

Check for a behavior change in JPAcascade strategy

No This rule flags projects using JPA entity relationships thatuse cascade types PERSIST, MERGE, or ALL because thereis a potential behavior change in WebSphere ApplicationServer V8.5. There is a corresponding XML rule to detect thisbehavior change.

JSP code review

Page 28: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

28 | WebSphere Application Server version migration rules and quick fixes

Under the JSP code review set, the WebSphere version migration category has rules described in the following table. Formore information, press F1 when viewing the rule in the results viewer.

Note: JSP pages written in XML syntax (JSP documents) are not supported.

Table 6: Migrating from Version 5.1

Rule Name QuickFix

Action Taken

Check for behavior change for includedJSP encoding

No In JSP 2.0, page encoding is done on a per-file basis. This ruledetects the statically included JSP files that have different pageencoding than the parent JSP.

Check for behavior change on therequest.getAttribute() method

No This rule flags calls to request.getAttribute() in JSP filesthat use automatic casting to a String. However in V6, therequest.getAttribute() method returns an Object, not a String.

Check for behavior change on URLscontaining a plus sign

No This rule flags a URI in a JSP link tag (<a>) or a form actiontag (<form action=...) that contain a plus ("+") character in theURI but not a part of the query parameters. The plus ("+") isonly reserved in the query string portion of the URL.

Do not use default packages in JSPimport statements

No As of JSP 2.0, you cannot refer to any classes from theunnamed (also known as the default) package. This rule detectsJSP Import Directives that contain classes from the defaultpackage.

Table 7: V6.1 to V7.0 migration

Rule Name QuickFix

Action Taken

Do not redefine a taglib prefix using adifferent URI

No This rule flags JSP taglib directives which associate thesame prefix attribute value with different uri attributevalues.

Table 8: V7.0 to V8.0 migration

Rule Name QuickFix

Action Taken

Do not use Java keywords in JSP and JSFexpression language elements

No This rule flags JSP expression language (EL) elements withvariables names that contain Java keywords or EL reservedkeywords.

XML code review

The XML file review provides rules to detect deployment descriptor and other XML file issues.

Page 29: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

WebSphere Application Server version migration rules and quick fixes | 29

Table 9: V6.1 to V7.0 migration

Rule Name QuickFix

Action Taken

Detect bad attributes of the global-transaction element

Yes This rule flags an invalid transaction timeout attribute of theglobal-transaction element in the ibm-ejb-jar-ext.xmlfile.

Do not use bean-managed persistence inEJB 3.0 projects

No This rule detects the use of bean-managed persistence in EJB3.0 projects, which is valid in the IBM WebSphere ApplicationServer V6.1 Feature Pack for Enterprise JavaBeans 3.0 but notin WebSphere Application Server V7.0.

Use application version 1.4 or lowerwhen migrating applications fromWebSphere V6.1 or prior

Yes When migrating from WebSphere Version 6.1 or prior, this ruleflags any application with a version higher than 1.4.

Use the metadata-complete attribute forJava EE 5 modules without annotations

No This rule flags Java EE 5 modules that do not have themetadata-complete attribute set.

Use web module version 2.4 or lowerwhen migrating applications fromWebSphere V6.1 or prior

Yes When migrating from WebSphere Version 6.1 or prior, this ruleflags any web module with a version 2.5 or higher which cancause migration issues.

Use unique EJB 3.0 binding names No WebSphere Application Server V6.1 Feature Pack for EJB3.0 allowed the EJB 3.0 binding file to contain duplicatebinding names. The V7.0 server runtime environment addeduniqueness checks for names used in the EJB 3.0 bindings file.Applications with uniqueness errors do not start in V7.0 eventhough the same application worked on the Feature Pack forEJB 3.0.

This rule validates the EJB 3.0 bindings file to verify bindingname uniqueness. It also validates that class names for sessioninterfaces and interceptors are fully qualified.

Table 10: V7.0 to V8.0 migration

Rule Name QuickFix

Action Taken

Check for a behavior change for EJBpresence in a web module

No This rule flags a web.xml file of a Web Module Version 2.5 orhigher if that module contains a .class file which has an EJBannotation. The .class file must be in a library (a .jar file inWEB-INF/lib).

Check for a behavior change inApplicationException inheritance

No This rule flags EJB ApplicationException definitions in ejb-jar.xml files which do not have the inherited attributeset. The inherited attribute was added in EJB 3.1 andchanged the default behavior of EJB 3.0 applications.

Check for a behavior change in JavaServer Faces (JSF) Applications

No This rule flags the Java Server Faces (JSF) application becausethe default implementation for JSF container has changed inWebSphere V8.0.

Page 30: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

30 | WebSphere Application Server version migration rules and quick fixes

Rule Name QuickFix

Action Taken

Check for a behavior change in JSPconfiguration of <is-xml> and <page-encoding> options

No This rule flags the <is-xml> and <page-encoding> JSPconfiguration options. The JSP specification was clarified withrespect to these configuration options and included JSP files,and the behavior changed in Version 8.0.

Check for a behavior change in webservices addressing policy

No This rule flags addressing policy configuration found in theWSDL definition. The addressing policy was ignored in theWSDL definition in previous releases. This behavior changewould cause problems only if the the addressing policy in thepackaged WSDL differs in a significant way from the activeconfigured addressing policy.

Detect validation.xml files No This rule flags the existence of XML files namedvalidation.xml within the project contents. In Java EE 6,validation.xml became a reserved filename for use by theBean Validation API.

Table 11: V8.0 to V8.5 migration

Rule Name QuickFix

Action Taken

Check for a behavior change in JPAcascade strategy

No This rule flags projects using JPA entity relationships that usecascade types PERSIST, MERGE, or ALL because there is apotential behavior change in WebSphere Application ServerV8.5. There is a corresponding Java rule to detect this behaviorchange.

Check for a behavior change in JPAMetaModel code generation concerningListAttribute

No This rule flags the persistence.xml file for a behavior change inJPA MetaModel code generation concerning ListAttribute inWebSphere V8.5.

Deprecated features

There are deprecation rules under the Java Code Review, JSP Code Review, and XML File Review categories. The rulesare organized by target release:• Migration to V7.0 - currently deprecated in V7.0 and removed in V8.0• Migration to V7.0 and V8.0 - currently deprecated in V7.0 and in V8.0• Migration to V8.0 - newly deprecated in V8.0• Migration to V8.5 - newly deprecated in V8.5

Table 12: Java deprecated features - Migration to V7.0

Rule Name QuickFix

Action Taken

Avoid using the deprecated ApacheSOAP API

No This rule flags references to the org.apache.soap andcom.ibm.soap packages.

Avoid using the deprecatedOracleDataStoreHelper class

Yes This rule flags the use of the deprecated Oracle data store helper andfield.

Page 31: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

WebSphere Application Server version migration rules and quick fixes | 31

Rule Name QuickFix

Action Taken

The quick fix changes the code to use the Oracle 11g helper afterconfirming that the server runtime configuration was changed.

Table 13: Java deprecated features - Migration to V7.0 and V8.0

Rule Name QuickFix

Action Taken

Avoid using the deprecated analyzerlogging system classes

No This rule flags the use of the deprecatedcom.ibm.websphere.als classes.

Avoid using the deprecated AntsetCompileWithAssert method

Yes This rule flags the use of the deprecated Ant methodsetCompileWithAssert.

The quick fix replaces the method with setJdkSourceLevel.

Avoid using the deprecatedAppDeploymentController methods

No This rule flags the use of the application deployment controllergetTaskInfo methods.

Avoid using the deprecatedAppDeploymentTask methods

Yes This rule flags the use of the deprecated methods from thecom.ibm.websphere.management.application.client.AppDeploymentTask class.

The quick fix changes the methods to the recommendedreplacements.

Avoid using the deprecatedapplication managementinstallStandaloneRAR method

No This rule flags the use of the application managementinstallStandaloneRAR method.

Avoid using the deprecatedapplication managementmoveModule method

No This rule flags the use of the application managementmoveModule method.

Avoid using the deprecatedapplication profile access intentmethods

No This rule flags the use of deprecated application profile access intentmethods.

Avoid using the deprecated Cacheinterface

No This rule flags the use of the com.ibm.websphere.Cacheinterface.

Avoid using the deprecatedcom.ibm.etools.logging utilities

No This rule detects and flags references tocom.ibm.etools.logging packages that are deprecated.

Avoid using the deprecated commandmanager methods

Yes This rule flags the use of the deprecated methods incom.ibm.websphere.management.cmdframework.CommandMgrInitializer class.

The quick fix changes the methods to the recommendedreplacements.

Avoid using the deprecatedConnectionFactory MBean methods

No This rule flags the deprecated ConnectionFactory MBeanoperations getPoolContents, getAllPoolContents, andshowAllocationHandleList.

Page 32: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

32 | WebSphere Application Server version migration rules and quick fixes

Rule Name QuickFix

Action Taken

Avoid using the deprecatedConnectionSpecImpl methods

Yes This rule flags the deprecated methods from thecom.ibm.websphere.ola.ConnectionSpecImpl class.

The quick fix changes the parameter to the appropriate booleanvalue.

Avoid using the deprecatedConnector Architecture interfaces

No This rule flags the deprecated Connector Architectureinterfaces com.ibm.websphere.j2c.ConnectionEventListener andcom.ibm.websphere.j2c.ConnectionManager.

Do not used the deprecateddistributed locking map field andremoved interface

No This rule flags the deprecated com.ibm.websphere.cache.DistributedObjectCache.TYPE_DISTRIBUTED_LOCKING_MAP field andthe removed com.ibm.websphere.cache.DistributedLockingMap interface.

Avoid using the deprecatedDumpNameSpace constructor andfields

No This rule flags the use of the deprecated constructor and fields fromthe com.ibm.websphere.naming.DumpNameSpace class.

Avoid using the deprecatedDynamicCacheAccessor methods

No This rule flags the use of the deprecated methods from thecom.ibm.websphere.cache.DynamicCacheAccessorclass.

Avoid using the deprecated dynamiccache methods and fields

No This rule flags the use of the deprecated methods and fields fromthe com.ibm.websphere.cache.CacheEntry and thecom.ibm.websphere.cache.EntryInfo interfaces.

Avoid using the deprecated EJBpersistence createInteraction method

No This rule flags the use of thecom.ibm.websphere.ejbpersistence.EJBToRAAdapter.createInteraction(javax.resource.cci.Connection conn) method.

Avoid using the deprecatedExtendedJTATransaction methodregisterSynchronizationCallbackForCurrentTran

No This rule detects and flags the methodregisterSynchronizationCallbackForCurrentTran from the class ExtendedJTATransaction.

Avoid using the deprecatedHttpServlet request/response proxyclasses

No This rule flags the use of the HttpServletRequestProxy andHttpServletResponseProxy classes.

Avoid using the deprecated interfaceSIBTransmitMessageRequest

Yes This rule flags the use of thecom.ibm.websphere.sib.admin.SIBTransmitMessageRequest interface.

The quick fix replaces the interface with thecom.ibm.websphere.sib.admin.SIBMessageRequest interface.

Avoid using the deprecated JRasextension APIs

No This rule flags deprecated Java reliability, availability, andserviceability APIs.

Page 33: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

WebSphere Application Server version migration rules and quick fixes | 33

Rule Name QuickFix

Action Taken

Avoid using the deprecatedLocalHomeAccessor class

No This rule flags the use of thecom.ibm.websphere.ejbcontainer.LocalHomeAccessor class.

Avoid using thedeprecated managementInvalidDocumentURIException class

Yes This rule flags the use of thecom.ibm.websphere.management.exception.InvalidDocumentURIException class.

The quick fix changes the code to useDocumentNotFoundException.

Avoid using the deprecatedmanagement NestedAdminExceptionclass

No This rule flags the use of thecom.ibm.websphere.management.exception.NestedAdminException class.

Avoid using the deprecatedmanagement NotificationConstantsTYPE_AGENT_DISCOVEREDfield

Yes This rule flags the use of theNotificationConstants.TYPE_AGENT_DISCOVEREDfield.

The quick fix replaces references to this field with theNotificationConstants.TYPE_DISCOVERY_AGENT_FOUNDfield.

Avoid using thedeprecated managementremoveNotificationListenerExtendedmethods

No This rule flags the use of the deprecatedremoveNotificationListenerExtended methods fromthe com.ibm.websphere.management.AdminServiceand com.ibm.websphere.management.AdminClientclasses.

Avoid using the deprecatedmanagement statistics interfaces

Yes This rule flags the use of thecom.ibm.websphere.management.statistics package.

The quick fix changes all references ofcom.ibm.websphere.management.statistics tojavax.management.j2ee.statistics and all reference ofMessageBeanStats to MessageDrivenBeanStats.

Avoid using the deprecated methodsfrom WebSphere SIB MQ classes

Yes This rule flags the use of the getNpmSpeed() andgetStatus() methods from SIB MQ classes.

The quick fix changes the methods to the recommendedreplacements.

Avoid using the deprecated namingproperties INITIAL_CONTEXT_FACTORY_LEGACY field

Yes This rule flags the use of the com.ibm.websphere.naming.PROPS.INITIAL_CONTEXT_FACTORY_LEGACY field.

The quick fix changes all references to thisfield to com.ibm.websphere.naming.PROPS.INITIAL_CONTEXT_FACTORY.

Avoid using the deprecated PMIClient API

No This rule flags the use of PMI Client API classes.

Avoid using the deprecatedPmiConstants fields

No This rule flags the use of deprecated PmiConstants fields.

Page 34: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

34 | WebSphere Application Server version migration rules and quick fixes

Rule Name QuickFix

Action Taken

Avoid using the deprecatedPmiDataInfo getParticipation method

No This rule flags the use of thecom.ibm.websphere.pmi.PmiDataInfo.getParticipation() method.

Avoid using the deprecatedPMI dynamic cacheOBJECT_CACHE_GROUP field

Yes This rule flags the use of the deprecatedcom.ibm.websphere.pmi.stat.WSDynamicCacheStats.OBJECT_CACHE_GROUP field.

The quick fix changes OBJECT_CACHE_GROUP toOBJECT_GROUP.

Avoid using the deprecatedPMI dynamic cacheSERVLET_CACHE_GROUP field

No This rule flags the use of the deprecatedcom.ibm.websphere.pmi.stat.WSDynamicCacheStats.SERVLET_CACHE_GROUP field.

Avoid using the deprecatedPmiJmxTest methods

No This rule flags the use of the deprecated methods from thecom.ibm.websphere.pmi.PmiJmxTest class.

Avoid using the deprecated PMIMBeanLevelSpec methods

No This rule flags the use of the deprecatedconstructors and methods from thecom.ibm.websphere.pmi.stat.MBeanLevelSpec class.

Avoid using the deprecatedPmiModuleConfig print method

No This rule flags the use of the deprecatedcom.ibm.websphere.pmi.PmiModuleConfig.print(PrintWriter) method.

Avoid using the deprecated PMIStatDescriptor methods

No This rule flags the use of the deprecatedconstructor and methods from thecom.ibm.websphere.pmi.stat.StatDescriptor class.

Avoid using the deprecated PMIstatistic classes

No This rule flags the use of the deprecated classes from thecom.ibm.websphere.pmi.stat package.

Avoid using the deprecated PMIWSStats methods

No This rule flags the use of the deprecated methods from thecom.ibm.websphere.pmi.stat.WSStats interface.

Avoid using the deprecatedRemoteCommandMgr MBean

No This rule flags the deprecated RemoteCommandMgr MBean.

Avoid using the deprecated resourceadapter classes and interfaces

No This rule flags the use of the deprecated resource adapter classes andinterfaces.

Avoid using the deprecated resourceadapter fields

No This rule flags the use of the deprecated resource adapter fields.

Avoid using the deprecated resourceadapter methods

No This rule flags the use of the deprecated resource adapter methods.

Avoid using the deprecated runtimeServerName methods

No This rule flags the use of methods deprecated from thecom.ibm.websphere.runtime.ServerName class.

Page 35: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

WebSphere Application Server version migration rules and quick fixes | 35

Rule Name QuickFix

Action Taken

Avoid using the deprecated schedulerMessageTaskInfo methods

No This rule flags the use of the deprecated methods from thecom.ibm.websphere.scheduler.MessageTaskInfoclass.

Avoid using the deprecated Schedulermethods

No This rule flags the use of the deprecatedcreateBeanTaskInfo() andcreateMessageTaskInfo() methods from thecom.ibm.websphere.scheduler.Scheduler class.

Avoid using the deprecated securityauthentication exception classes

No This rule flags the use of the deprecated exceptionclasses com.ibm.websphere.security.auth.MapCredentialFailedException andcom.ibm.websphere.security.auth.MapCredentialNotSupportedException.

Avoid using the deprecated securityauthentication WSPrincipalgetCredential method

No This rule flags the use of the deprecatedgetCredential() method from thecom.ibm.websphere.security.auth.WSPrincipalclass.

Avoid using the deprecated securityprintStackTrace() methods

No This rule flags the use of the deprecated printStackTrace()methods from the com.ibm.websphere.security.WSSecurityException andcom.ibm.websphere.security.auth.WSLoginFailedException classes.

Avoid using the deprecated securityLoginHelper class

No This rule flags the use of the deprecatedcom.ibm.ws.security.util.LoginHelper class.

Avoid using the deprecated servletcache classes

No This rule flags the use of the deprecated servlet cache classes.

Avoid using the deprecated servletcache IdGenerator methods

No This rule flags the use of the deprecated methodsinitialize() and getSharingPolicy() from thecom.ibm.websphere.servlet.cache.IdGeneratorclass.

Avoid using the deprecated servletcache MetaDataGenerator initializemethod

No This rule flags the use of the deprecated initialize() methodfrom the com.ibm.websphere.servlet.cache.MetaDataGenerator class.

Avoid using the deprecatedSIMediationBeanMessageContextinterface

No This rule flags the use of the deprecatedcom.ibm.websphere.sib.mediation.messagecontext.SIMediationBeanMessageContextinterface.

Avoid using the deprecatedSIMessageContextException class

Yes This rule flags the use of the deprecatedcom.ibm.websphere.sib.mediation.handler.SIMessageContextException class.

The quick fix changes the code to useMessageContextException instead.

Page 36: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

36 | WebSphere Application Server version migration rules and quick fixes

Rule Name QuickFix

Action Taken

Avoid using the deprecatedTransactionControl interface

No This rule flags the use of the deprecatedcom.ibm.ws.extensionhelper.TransactionControl interface.

Avoid using the deprecated UDDIVersion 2 interfaces

No This rule flags the use of UDDI Version 2 related packages.

Avoid using the deprecatedUNTGenerateCallback methods

Yes This rule flags the use of the deprecated methodsfrom the com.ibm.websphere.wssecurity.callbackhandler.UNTGenerateCallback class.

The quick fix changes the methods to the recommendedreplacements.

Avoid using the deprecatedWASProduct class

No This rule flags the deprecatedcom.ibm.websphere.product.WASProduct class wasused to get product installation information and history.

Avoid using the deprecated webcontainer custom extension classes

No This rule flags the deprecated web container custom extensionclasses from the com.ibm.servlet package.

Avoid using the deprecatedWebContainer MBean operations

No This rule flags references to the deprecated WebContainer MBeanoperations startTransports, stopTransports, andrestartWebApplication.

Avoid using the deprecatedWebSphere Ant classModuleValidator

No This rule flags the use of the deprecated WebSphere Ant classcom.ibm.websphere.ant.tasks. ModuleValidator.

Avoid using the deprecatedWebSphere Studio tools runtimeclasses

No This rule flags the use of the deprecated WebSphere Studio toolsruntime classes from the com.ibm.webtools.runtimepackage.

Avoid using the deprecatedWSAddressing for JAXWS 2.0classes

No This rule flags the deprecated WSAddressingfor JAXWS 2.0 classes from thecom.ibm.websphere.wsaddressing.jaxws package.

Avoid using the deprecatedWsnBatchResult fields

Yes This rule flags use of deprecated fields from thecom.ibm.websphere.naming.WsnBatchResult class.

The quick fix changes the fields to the recommended replacements.

Table 14: Java deprecated features - Migration to V8.0

Rule Name QuickFix

Action Taken

Avoid extending theAppDeploymentTask class

No This rule flags any class that extendscom.ibm.websphere.management.application.client.AppDeploymentTask.

Avoid using the deprecatedAppConstants fields

No This rule flags the use of the deprecated fields from thecom.ibm.websphere.management.application.AppConstants class.

Page 37: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

WebSphere Application Server version migration rules and quick fixes | 37

Rule Name QuickFix

Action Taken

Avoid using the deprecatedAppManagementBaseFactorymethods

No This rule flags the use of the deprecated methods from thecom.ibm.websphere.management.application.AppManagementBaseFactory class.

Avoid using the deprecatedcom.ibm.websphere.product classes

No This rule flags the deprecated classes from thecom.ibm.websphere.product packages.

Avoid using the deprecated elementsin the EditionInfo class

No This rule flags the use of the deprecated elements from thecom.ibm.websphere.management.application.EditionInfo class.

Avoid using the deprecated elementsin the IFilterConfig interface

No This rule flags the use of the deprecated elements fromthe com.ibm.websphere.servlet.filter.IFilterConfig interface.

Avoid using the deprecated field inthe AppDeploymentController class

No This rule flags the use of the deprecatedfield taskHelperSuffix from the classcom.ibm.websphere.management.application.client.AppDeploymentController.

Avoid using the deprecated IRequestisStartAsync() method

No This rule flags the use of the deprecatedmethod isStartAsync() from the interfacecom.ibm.websphere.servlet.request.IRequest.

Avoid using the deprecatedWASDirectory methods and fields

No This rule flags the deprecatedcom.ibm.websphere.product.WASDirectory methodsand related fields.

Avoid using the deprecatedWebSphere Studio ApplicationDeveloper Integration Editionlibraries

No This rule flags the use of the deprecated WebSphere StudioApplication Developer Integration Edition libraries.

Table 15: Java deprecated features - Migration to V8.5

Rule Name QuickFix

Action Taken

Avoid using the deprecated CommonEvent Infrastructure packages

No This rule flags APIS from the deprecated com.ibm.eventspackages.

Avoid using the deprecatedWSSecurityHelpergetLTPACookieFromSSOTokenmethod

Yes This rule flags the deprecatedcom.ibm.websphere.security.WSSecurityHelpergetLTPACookieFromSSOToken method.

Avoid using the deprecatedWSSecurityHelperrevokeSSOCookies method

Yes This rule flags the deprecatedcom.ibm.websphere.security.WSSecurityHelperrevokeSSOCookies method.

Page 38: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Table 16: JSP file deprecated features - Migration to V7.0 and V8.0

Rule Name QuickFix

Action Taken

Avoid using the deprecated JSP<tsx> tags

No This rule flags the use of the deprecated <tsx> tags in JSP files.

Table 17: XML file deprecated features - Migration to V7.0 and V8.0

Rule Name QuickFix

Action Taken

Avoid using the deprecated method-level access intent for entity beans

No This rule flags the use of method-level access intent on entity beans.

Avoid using the deprecated reloadattributes of the IBM deploymentdescriptor extensions

No This rule flags the deprecated reloadInterval andreloadingEnabled attributes of the IBM deployment descriptorextensions, including both the WAR file extension (WEB-INF/ibm-web-ext.xmi) and the application extension (META-INF/ibm-application-ext.xmi).

Page 39: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Java SE version migration | 39

Java SE version migration

Under the Java Code Review set of rules, Java SE Migration category contains rules for migrating from J2SE 1.4, J2SE5.0, or Java SE 6. Java migration targets are Java SE 6 and Java SE 7.

The Sun to IBM Java compatibility impacts category provides a set of rules to migrate Sun APIs that are notavailable on the IBM Java Runtime Environment. Where possible, the rules migrate the code to use javax.net orcom.ibm.net.ssl classes.

The specific rules selected depends on your selection of the source Java Runtime Environment that your applicationpreviously used and the version of WebSphere you are migrating to. For WebSphere Application Server V8.5, you canchoose either Java SE 6 or Java SE 7 as your target.

Quick fixes are available where possible. Rules without quick fixes flag the rule violations so you can evaluate their usageand migrate the code manually if needed.

Table 18: J2SE 5.0 compatibility impacts

Rule Name QuickFix

Action Taken

Check for JAXP API usage compatibility No The JAXP APIs used in JRE 1.4.2 might have compatibilityissues when used in JRE 5. This rule detects the import of anyJAXP-related packages so that you can check the usage.

Check for JAXPEntityResolver.resolveEntity() exceptioncompatibility

No JAXP EntityResolver.resolveEntity(String,String) now throws the exception, IOException, in additionto SAXException. This rule detects the missing IOException.

Check for new JAXP DOM APIs No New JAXP DOM APIs where added to the followinginterfaces:

• org.w3c.dom.Attr• org.w3c.dom.Document• org.w3c.dom.DOMImplementation• org.w3c.dom.Element• org.w3c.dom.Entity• org.w3c.dom.Node• org.w3c.dom.Text

This rule detects classes that implement any of these interfacesand flags them so that the new interfaces can be added.

Check Java Object Serializationcompatibility

No Serialization in not consistent between Java 1.4and Java 5.0. This rule detects the classes thatimplement java.io.Serializable without aserialVersionUID field.

Do not make direct references toIBMJSSEFIPS provider classes

No The IBMJSSEFIPS provider has been included in theIBMJSSE2 support. References to the classes of the previousprovider, com.ibm.fips.*, must be removed.

This rule detects the use of any reference to com.ibm.fipspackages.

Page 40: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

40 | Java SE version migration

Rule Name QuickFix

Action Taken

Do not use APIs from com.ibm.net.sslpackages

Yes The classes and interfaces in the com.ibm.net.sslpackage have been replaced by classes and interfaces in thejavax.net.ssl package. This rule detects the use of anyreference to com.ibm.net.ssl packages.

The quick fix changes package names com.ibm.net.ssl tojavax.net.ssl.

Do not use APIs from sun.* packages No Some APIs in the sun.* packages changed in JRE 5 andhave compatibility issues with JRE 1.4.2. These APIs are notintended for use by developers. This rule detects the use of anyreference to sun.* packages.

Do not use JAXP 1.1 internal classes No Internal JAXP classes changed. Do not use these internalclasses in these packages:

1. org.apache.crimson.*2. org.apache.xml.*3. org.apache.xalan.*4. org.apache.xpath.*5. org.apache.xalan.xsltc.*

This rule detects the use of these packages and flags them.

Do not use JAXP 1.1 package names instring literals

No Some of the implementation package names changed betweenJAXP 1.1 and JAXP 1.3. This rule detects JAXP 1.1 packagenames used in string literals.

Do not use removed IBMJSSE APIs No In the conversion from IBMJSSE to IBMJSSE2two of the JSSE classes were removed. This ruledetects the use of any reference to com.ibm.jsse.KeyManagerFactoryParametersSpecand com.ibm.jsse.SSLContext.Since com.ibm.net.ssl.KeyManagerFactoryParametersSpecwas migrated to com.ibm.jsse.KeyManagerFactoryParametersSpec andthen removed from use, com.ibm.net.ssl.KeyManagerFactoryParametersSpec is also detectedwith this rule.

Do not use the Java reserved word enum No Beginning in Java 5.0, enum is a reserved Java type andcannot be used as a variable name any longer. If your code usesvariables named enum, they must be renamed. This rule detectsvariables and arguments named enum.

Use the BigDecimal toPlainString()method explicitly when deriving a stringvalue

No The BigDecimal toString() method behaves differentlythan in earlier versions. J2SE 5.0 added toPlainString()to BigDecimal, which behaves like the toString()method in earlier versions. This rule detects the implicit use ofthe toString() method in a class.

Page 41: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Java SE version migration | 41

Rule Name QuickFix

Action Taken

Use the BigDecimal toPlainString()method instead of the toString() method

Yes The BigDecimal toString() method behaves differentlythan in earlier versions. J2SE 5.0 added toPlainString()to BigDecimal, which behaves like the toString()method in earlier versions.

The quick fix changes toString to toPlainString.

Use the IBMJSSE2 Provider Yes In the conversion from IBMJSSE to IBMJSSE2, theproviders, IBMJSSEProvider and JSSEProvider, are replacedby IBMJSSEProvider2. This rule detects the use of anyreference to com.ibm.jsse.IBMJSSEProvider andcom.ibm.jsse.JSSEProvider classes.

The quick fix changes the reference tocom.ibm.jsse2.IBMJSSEProvider2.

Table 19: Java SE 6 compatibility impacts

Rule Name QuickFix

Action Taken

Check exception logic for calls toEventHandler

No In Java SE 6, the EventHandler constructor and create()methods require non-null parameters to be passed. This ruleflags the constructor and create() method calls so that youcan verify your logic handles a NullPointerException properly.

Check for Duration andXMLGregorianCalendar equals()compatibility

No Detect the use of Duration andXMLGregorianCalendar equals() method. Java 6 nowreturns false if the parameter passed is null. The exception,NullPointerException, was thrown previously.

Check for theOverlappingFileLockException for theFileChannel lock() method

No In Java SE 6, the FileChannel.lock() method nowthrows OverlappingFileLockException. This ruleflags the lock() method calls without a catch block forOverlappingFileLockException or without a throwsdeclaration for OverlappingFileLockException on themethod.

Remove use of double slashes in JMXObjectName elements

No Detect the use of the double-slash character string ("//") in JMXObjectNames.

Table 20: Java SE 7 compatibility impacts

Rule Name QuickFix

Action Taken

Check for a behavior change for anempty TreeSet add and TreeMap putmethods

No This rule flags the use of java.util.TreeSet or java.util.TreeMap.Depending on the configuration of the rule, either theconstructor or the add()/put() methods of these classes will getflagged. A new behavior is added in Java 7 for these methods.

Check for a behavior change for AWTException Handler

No This rule flags the string literalsun.awt.exception.handler. A new exceptionhandling mechanism is added in Java 7.

Page 42: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

42 | Java SE version migration

Rule Name QuickFix

Action Taken

Check for a behavior change for FilesetReadOnly, setWritable and canWritemethods

No This rule flags the methods java.io.FilesetReadOnly(), setWritable(boolean arg) andsetWritable(boolean arg, boolean user). Anew behavior is added in Java 7 for these methods.

Check for a behavior change forURLConnection, HttpURLConnectiongetInputStream method

No This rule flags the getInputStream() method onURLConnection or HttpURLConnection. This methodhas a new behavior in Java 7.

Check for a behavior change onDatagramChannel send, receive, andconnect methods

No This rule flags calls to thejava.nio.channels.DatagramChannel send,receive, and connect methods that have a new behavior inJava 7.

Check for a behavior change on theisLowerCase and isUpperCase methods

No This rule flags the isLowerCase and isUpperCasemethods. There is a very slight chance that a behavior change inthese methods could affect your application.

Check for a behavior change on LocalegetDefault method

No This rule flags calls to the java.util.Locale getDefault() methodas it has a new behavior.

Check for a behavior change onMouseEvent getButton method

No This rule flags instances of thejava.awt.event.MouseEvent getButton() methodas it has a new behavior.

Check for a behavior change onThreadGroup setMaxPriority method

No This rule flags the method setMaxPriority on aThreadGroup object. The method behavior has changed inJDK 7.

Check for a behavior change on ToolkitgetPrintJob method

No This rule flags instances of the java.awt.ToolkitgetPrintJob(...) method as it has a new behavior.

Check for a behavior change on WindowsetBackground method

No This rule flags calls to the java.awt.WindowsetBackground() method because its behavior changed bythrowing a new exception.

Check for classes implementing theTypeVisitor interface

No This rule flags classes implementing thejavax.lang.model.type.TypeVisitor interface. InJava SE 7, a new method was added to this interface.

Check for new methods on JDBCinterfaces

No This rule detects classes that implement theJDBC interfaces that added new methods. Theinterfaces include java.sql.Connection,java.sql.Driver, java.sql.Statement, andjavax.sql.CommonDataSource.

Do not define methods declared as finalin java.lang.Throwable

No This rule detects class that extend java.lang.Throwablethat implement methods addSuppressed andgetSuppressed which were added as new final methods inJava 7.

Do not override the Path2DgetPathIterator methods

No This rule flags the Path2D getPathIterator methods.These methods are now marked final in Java 7.

Do not use removed classXSLTProcessorApplet

No This rule detects the use of the classorg.apache.xalan.client.XSLTProcessorApplet.This class has been removed from JDK 7 release.

Page 43: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Java SE version migration | 43

Run the following rules when you are migrating your application from an Oracle Java Runtime Environment to an IBMJava Runtime Environment. If you are running Liberty profile server using an Oracle Java Runtime, do not run the quickfixes for these rules.

Table 21: Oracle to IBM compatibility impacts

Rule Name QuickFix

Action Taken

Detect com.sun.net.ssl.internal packages No This rule flags import statements of certaincom.sun.net.ssl.internal packages in Java files that are notavailable and should not be used.

Do not use APIs from com.sun.net.sslpackages

Yes This rule detects the classes and interfaces in the>com.sun.net.ssl package have been replaced by classesand interfaces in the javax.net.ssl package.

Do not use com.sun.org.apache JAXPinternal classes

No This rule flags internal Sun JAXP classes are not available inthe IBM Java Runtime Environment.

Do not use com.sun.org.apache JAXPpackage names in string literals

No This rule detects com.sun.org.apache JAXP 1.3 packagenames that are used in string literals.

Do not use thecom.sun.net.ssl.internal.ssl.Provider

Yes This rule flags the classcom.sun.net.ssl.internal.ssl.Provider shouldbe replaced by com.ibm.jsse.IBMJSSEProvider.

Do not use the com.sun.net.ssl.internal.www.protocol.https.Handler class

Yes This rule flags thecom.sun.net.ssl.internal.www.protocol.https.Handler class that should be replaced bycom.ibm.net.ssl.www2.protocol.https.Handler.

Do not use thecom.sun.net.ssl.internal.www.protocolpackage

Yes This rule flags thecom.sun.net.ssl.internal.www.protocolpackage references that should be replaced bycom.ibm.net.ssl.www2.protocol.

Only run the following rules when you are migrating your application from an Oracle Java Runtime Environment to anIBM Java Runtime that contains the IBM class. For example, the HP-UX and Solaris Java Runtime Environment that shipswith WebSphere Application Server does not contain the class. This rule is not selected automatically by any rule set.

Table 22: Sun internal APIs

Rule Name QuickFix

Action Taken

Do not use APIs from thesun.security.x509 package

Yes The classes and interfaces in the sun.security.x509package are replaced by classes and interfaces in thecom.ibm.security.x509 package on some operatingsystems.

Page 44: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

44 | Troubleshooting

Troubleshooting

Software Analyzer options not shown

Installing an application migration tool creates a Software Analyzer menu and toolbar options in the Java, Debug, Plug-in Development, and C++ perspectives. When you use other perspectives, you must enable these options manually bycompleting the following steps:

1. From your perspective, select Window > Customize Perspective from the IDE menu.2. In the Customize Perspective window, click the Commands tab and select Software Analyzer.3. Click OK.

Figure 19: Software Analyzer availability

Java EE constructs or JSP not read correctly

For the tools to read project files correctly, the projects must be set up with their appropriate project facets. For example,projects that contain enterprise beans must have the EJB Module facet. You can see facets for a project by right-clickingthe project in the project explorer and selecting Properties. Select the Project Facets property. Projects containing webmodules must be dynamic web projects. See Importing applications on page 10 for more information.

Logging and trace

The application migration tools write error information to two log files:

• The workspace log (workspace/.metadata/.log) contains messages logged by the application migration toolsand messages logged by Rational Software Analyzer.

• The service logs for the application migration tools are located in the workspace/.metadata/.plugins/com.ibm.ws.appconversion.base directory. These logs contain all error information. If trace is enabled, thelogs also contain detailed trace information.

Enable trace in the migration tools by setting the appconversion.trace system variable on the command line tolaunch the IDE or in the eclipse.ini properties file; for example:

Page 45: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Troubleshooting | 45

• Command-line option. Add the system variable to the command line that starts Eclipse:

eclipse.exe -vmargs -Dappconversion.trace=true• eclipse.ini option. Add the following option to the eclipse.ini file found in the same directory as the eclipse.exe

file:

-Dappconversion.trace=true

Reports and history

In the Software Analyzer Results window, you can export a history of each analysis provider for the selected analysisrun. Export the history as XML data or generate a formatted HTML or PDF file by clicking on the respective icons in theupper-right corner of the analysis provider tab.

Generated PDF reports are saved in the workspace/.metadata/.plugins/com.ibm.xtools.analysis.reporting/reports directory.

Markers

Markers are displayed in the left margin of Eclipse editors and provide information about the content of the editor on theline where the marker is displayed. Editors for different file types can have different behaviors for the markers, some ofwhich are described here.

Figure 20: Analysis rule markers in a Java editor

No pop-up window displays when you click the marker

This issue affects non-Java based rules. For a Java rule, clicking the marker allows the quick fix to be performed.However, clicking the marker for the XML rule has no action, and hovering over the marker only displays the help text.Use the Software Analyzer Results view to select the Quick Fix action in non-Java files.

Double-clicking a marker removes the marker

Double-clicking the marker in the file editor removes the marker without applying the quick fix. If this happens, run theanalysis again to flag the problem again.

Cannot select multiple markers on the same line

When there are multiple markers on the same line of text, you cannot toggle between the different markers. You mustcarry out the action of the first marker to select successive markers. To apply a quick fix in such a case, use the SoftwareAnalyzer Results view to select the Quick Fix action you want, rather than relying on the marker.

Known issues

Quick Fix All Category

When you use the Quick Fix All Category option, let it run to completion before running it on another rule provider.Also, do not run Quick Fix All Category again on the same provider where it is already running. Wait until it completes.

If you notice errors being logged when running the Quick Fix All Category option, there are a few things you can do inEclipse to mitigate issues:

• In Window > Preferences > General > Editors, select Close editors automatically and set a value for Number ofopen editors before closing. The default value is 8, but you can limit it further.

Page 46: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

46 | Troubleshooting

• Choose Run in Background to prevent all the editors from opening and possibly running out of window handles.• Disable the automatic build feature of Eclipse (Project > Build Automatically) while running Quick Fix All

Category. Manually build the projects, and enable the option again after running Quick Fix All Category.

Multiple rules on the same node

When multiple rules are flagged on the same node, only the first quick fix applied runs correctly. You might need to runthe analysis multiple times to make sure that all code is fixed and processed correctly.

Viewing external links from help in Linux

Many detailed help pages have external references to information applicable to the specific rule. This information is bestviewed from an external browser rather than the Eclipse help view. On Windows platforms, help automatically launchesthese external references in the default browser. On Linux operating systems, it displays the information in the Eclipse

help view. To manually open help in an external browser, use the Show in external window icon ( ) on the detailed helppage.

Ignore Results

If you select Ignore Results on a line of code that is the beginning of a block of Java code with nested results that areflagged for the same rule, the nested results line numbers are set to zero. You can rerun the analysis to see the proper linenumbers. Examples of statements that cause this issue are method declarations and if statements.

View Results for .xmi files

If you select View Results for an .xmi file and get an error when you open the file, add an .xmi file association. Go toWindow > Preferences > General > Editors > File Associations, click Add, and enter *.xmi. Select either XML Editoror Text Editor, and click Default. Click OK to save.

Uncategorized plug-ins

If you are installing the tools on Rational Application Developer 7.5, it is preferable to not select Uncategorized from therepository site. If you select Uncategorized and later want to uninstall the tool, you must manually uninstall these plug-ins:

• Analysis Reporting nl1 version• Analysis Reporting nl2 version• Command Line Analysis• Command Line Analysis nl1 version• Command Line Analysis nl2 version• Compatibility feature• Core_feature Feature• JEE Code Review• JEE Code Review nl1 version• JEE Code Review nl2 version• J2SE Code Review• J2SE Code Review nl1 version• J2SE Code Review nl2 version• Java Architectural Discovery• Java Code Review Feature Translations• Java Globalization Code Review• Java Globalization Code Review nl1 version• Java Globalization Code Review nl2 version• Java Security Code Review• Java Security Code Review nl1 version• Java Security Code Review nl2 version

Page 47: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

Troubleshooting | 47

• ODA Compatability Feature• Rational Code Analyst Core Services Feature• Rational Software Analyzer Architecture Core• Rational Software Analyzer Code Review Core• Rational Software Analyzer Java Code Review• Rational Software Analyzer Reporting• Rational Software Analyzer Reporting ODA• RCA Analysis Feature Translations

This problem does not occur in Eclipse 3.5 and higher.

Rational Application Developer installation dependency conflicts

If an application migration tool installation fails with a conflicting dependency error, you might need to remove theRational Application Developer Code Analysis or Code Review feature. The feature name depends on your Rationalproduct version.

The following message is an example of a code dependency error:

Cannot complete the install because of a conflicting dependency.Software being installed: Application Migration Tool - WebSphere Version toVersion 3.0.1.201111170830 (com.ibm.ws.appconversion_feature.was2was.feature.group3.0.1.201111170830)Software currently installed: Shared profile 1.0.0.1322626949228(SharedProfile_bootProfile 1.0.0.1322626949228)

Only one of the following plugins can be installed at once:Analysis History Data Source ODA Runtime Driver 7.0.100.v20100517_2203(com.ibm.rsar.analysis.reporting.oda 7.0.100.v20100517_2203)Analysis History Data Source ODA Runtime Driver 7.0.100.201111170830(com.ibm.rsar.analysis.reporting.oda 7.0.100.201111170830)

To uninstall the Rational Application Developer Code Analysis or Code Review feature, start IBM Installation Manager,and select the Modify option. Select your Rational Application Developer installation from the Modify Packages list.Click Next, and clear Code Analysis selection from the list of features. Click Next, and verify that Code Analysis is in thelist of features to be removed. Proceed with the removal of the feature.

After Installation Manager completes, install the toolkit again.

Java Code Review Severity Summary HTML report in Windows does not display

The Java Code Review Severity Summary HTML report in Windows does not display in the Eclipse HTML viewerunless you use Internet Explorer 9, which supports SVG image files.

You can work around this problem in the following ways:

• Produce a PDF file instead of an HTML file.• Produce an HTML file, right-click the view to Create Shortcut, then open the shortcut using a browser that supports

SVG files on Windows, such as Mozilla Firefox.

Page 48: Application Migration Tool for WebSphere Version Migrationpublic.dhe.ibm.com/software/dw/wes/migrationtoolkit/Application... · and quick fixes are documented in the section WebSphere

48 | Copyright and trademarks

Copyright and trademarks

© Copyright IBM Corporation 2009, 2013.

The information contained in this publication is provided for informational purposes only. While efforts were madeto verify the completeness and accuracy of the information contained in this publication, it is provided AS IS withoutwarranty of any kind, express or implied. In addition, this information is based on IBM's current product plans andstrategy, which are subject to change by IBM without notice. IBM shall not be responsible for any damages arising out ofthe use of, or otherwise related to, this publication or any other materials. Nothing contained in this publication is intendedto, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or alteringthe terms and conditions of the applicable license agreement governing the use of IBM software.

References in this publication to IBM products, programs, or services do not imply that they will be available in allcountries in which IBM operates. Product release dates and/or capabilities referenced in this presentation may change atany time at IBM's sole discretion based on market opportunities or other factors, and are not intended to be a commitmentto future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have theeffect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth, savingsor other results.

Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment.The actual throughput or performance that any user will experience will vary depending upon many factors, includingconsiderations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storageconfiguration, and the workload processed. Therefore, no assurance can be given that an individual user will achieveresults similar to those stated here.

IBM, the IBM logo, developerWorks, Passport Advantage, Rational, and WebSphere are trademarks of InternationalBusiness Machines Corporation in the United States, other countries or both.

Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates.

Other product and service names might be trademarks of IBM or other companies.