Sie sind auf Seite 1von 37

WebSphere Application Server

Application Migration Tool


Built on Rational Software Analyzer technology

Version 1.0.0
December 4, 2009

A combined effort:
IBM Software Group, Application and Integration Middleware Software
IBM Software Group, Rational Software

© Copyright IBM Corp. 2009


This page intentionally left blank.
(So the table of contents prints right side when duplexed)
Application Migration Tool

Table of Contents
Overview ..................................................................................................................................................4
Support ....................................................................................................................................................5
Installing and updating the migration tool ...........................................................................................6
Importing applications in Eclipse..........................................................................................................9
Configuring the tool for analysis.........................................................................................................15
Running the analysis............................................................................................................................21
Completing the process .......................................................................................................................24
WebLogic to WebSphere Application Server rules and quick fixes ................................................25
Java code review rules .........................................................................................................................25
JSP code review...................................................................................................................................28
XML file review .....................................................................................................................................28
Class path review .................................................................................................................................30
Troubleshooting....................................................................................................................................31
Software Analyzer options not shown ..................................................................................................31
Java EE constructs or JSP not read correctly ......................................................................................31
Logging and trace.................................................................................................................................32
Reports and history ..............................................................................................................................32
Known Issues .......................................................................................................................................32
Copyrights and trademarks .................................................................................................................36
Document change history....................................................................................................................37

© 2009, IBM SWG -3- Version 1.0.0 Date: Friday, December 04, 2009
Overview

Converting Java™ Platform, Enterprise Edition (Java EE) applications from one third-party
application server to another platform can be costly and time consuming. The conversion
process can involve modifying Java source code, JavaServer™ Pages (JSP), and deployment
descriptors. The Application Migration Tool can assist you in performing these types of
migrations.

The Application Migration Tool is part of the IBM® WebSphere® Application Server Migration
Toolkit. This toolkit is part of the overall strategy and plan for assisting customers in migrating
from one application server to the IBM WebSphere Application Server.

This document explains how to install, configure, and use the tooling to assist in the
conversion process. The tooling is based on IBM Rational® Software Analyzer, which provides
a single solution to identify, analyze, and optimize the application health. The migration toolkit
uses the scanning capabilities of Rational Software Analyzer to look for specific constructs
unique to the Oracle® WebLogic application server. The tool then provides a way to review
and change that data so that the application can run on IBM WebSphere Application Server.

The tool flags a number of known differences between applications hosted on Oracle
WebLogic and WebSphere Application Server. In many cases, the tool can automatically
convert these key differences. If the tool is unable to perform the fix, it flags the file in question
to provide insight to where design changes are needed. The migration tool is compatible with:

 WebSphere Application Server Version 7.0


 Java EE 1.4 and prior versions

© 2009, IBM SWG -4- Version 1.0.0 Date: Friday, December 04, 2009
Support
The Application Migration Tool scans for a number of known issues in applications being migrated from
WebLogic to WebSphere Application Server. Where possible, a quick fix is provided to change your
code to a more portable solution. Supported rules and quick fixes are documented in WebLogic to
WebSphere Application Server rules and quick fixes on page 25. The tool will be updated on
developerWorks® as new rules and quick fixes are available.

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

During the scanning process, the tool detects areas that require design changes and code rewrites.
The tool highlights these problem areas but does not provide a quick fix.

The tool does not catch all problems. As you encounter patterns that the tool does not flag, we want to
hear your feedback. The Application Migration Tool forum is available to provide input and get
questions answered. (http://www.ibm.com/developerworks/forums/forum.jspa?forumID=2106).

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

For more information on the Rational Software Analyzer product, go to


http://www.ibm.com/developerworks/rational/products/rsar/.

© 2009, IBM SWG -5- Version 1.0.0 Date: Friday, December 04, 2009
Installing and updating the migration tool
The Application Migration Tool is a plug-in that you install into an existing Eclipse IDE, version 3.4.2
or higher. The preferred environments are Rational Application Developer or Rational Application
Developer for Assembly and Deploy so that you have all the tools for application development and
deployment. However, the tool works with a basic Eclipse IDE. If an Eclipse IDE is not already
installed, then download and install Eclipse 3.4.2 or higher from http://www.eclipse.org.
To install or update the Application Migration Tool, perform the following steps:
1. Download the latest version of the migration toolkit from developerWorks site
http://www.ibm.com/developerworks/websphere/downloads/migration_toolkit.html and
save it locally.
2. Start the Eclipse IDE.
3. If this is not a Rational Application Developer environment, install the prerequisite plug-ins
from either the Galileo or Ganymede site depending on your Eclipse version. Rational
Application Developer is configured with the required plug-ins. Use the appropriate
example, depending on your version of Eclipse:
For Eclipse 3.5 and higher For Eclipse 3.4 (3.4.2 and higher)

From the Eclipse menu bar, select Help > Install New From the Eclipse menu bar, select Help > Software
Software… updates…
Using the Galileo update site Using the Ganymede update site
(http://download.eclipse.org/releases/galileo), install (http://download.eclipse.org/releases/ganymede), install
Business Intelligence, Reporting and Charting and Charting and Reporting and Web and Java EE
Web, XML, and Java EE Development. Development.

Figure 1: Eclipse plug-in installation


© 2009, IBM SWG -6- Version 1.0.0 Date: Friday, December 04, 2009
4. Use the previous installation dialog to install or update the Application Migration Toolkit.
Click Add… in Eclipse 3.5 or click Add Site… in Eclipse 3.4.

5. In the Add Site window, enter the following information: (Figure 2: Tool installation).

Name: Application Migration Tool

Location: Use the Archive… button to find the compressed file you downloaded.

Figure 2: Tool installation

6. Click OK.

7. Complete the following actions in the Install window: (Figure 3: Select Plug-in)

a. Select the checkbox for Application Migration Tool.

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

8. Click Next on the Install Details panel.

9. On the Review Licenses panel, read the terms and accept the license agreements, if any
are presented. Click Finish. The install status window shows the installation progress.

© 2009, IBM SWG -7- Version 1.0.0 Date: Friday, December 04, 2009
Figure 3: Select Plug-in

10. Restart the Eclipse environment when the Software Updates window is displayed.

Figure 4: Restart dialog

© 2009, IBM SWG -8- Version 1.0.0 Date: Friday, December 04, 2009
Importing applications in Eclipse
If the application to migrate is not already in Eclipse, you must import the application enterprise archive
(EAR) file or modules with source code into Eclipse before performing analysis. The preferred
approach for doing this is to create new projects in the workspace for each EAR, Web archive (WAR),
and Enterprise JavaBeans™ (EJB) module. The EAR file should be created as an enterprise
application project. Each WAR file within the EAR file should be created as a dynamic Web project,
and each EJB module should be created as an EJB project. You must install Java EE Developer Tools
for Eclipse to create these projects.

Review the following guidelines for structuring projects:

 Java source code for a WAR file (for example, servlet, model, or utility classes), belong in the
src folder of the project. The src folder is defined and can be changed in the Java Build Path
properties for the project. If the Java source code needs to be referenced by more than one
WAR, 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 path rule and its quick fix to update the class paths correctly.

Shared Java projects


In some cases Java source files belong in a separate project rather than in the Web project. For
example, organize files in this manner when multiple WAR files within the same Web application
reference common classes or to improve the organization of the Web application.

There are two options for referencing those Java classes from a Web project:

1. Create a single copy of the Java project’s JAR file in the EAR file. Each WAR file references the
JAR file. This approach is preferable, since it reduces the size of the EAR file.

2. Create a copy of the JAR file in each WAR file. This approach works well if only one WAR file
references the JAR file.

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 project’s src folder.

2. Go to the Properties dialog of the EAR project (right-click the project in the Project view and
select Properties). Select the Java EE Module Dependencies item from the left pane, and on
the right pane select the checkbox next to the Java projects you want to reference.

© 2009, IBM SWG -9- Version 1.0.0 Date: Friday, December 04, 2009
Figure 5: Java EE EAR module dependencies

3. Open the Properties dialog for each Web project that needs to reference a JAR file. Select the
Java EE Module Dependencies item from the left pane, and ensure that the J2EE Modules
tab is selected. Select the checkbox beside the JAR files to reference.

© 2009, IBM SWG - 10 - Version 1.0.0 Date: Friday, December 04, 2009
Figure 6: Java EE Module Dependencies

For the second approach, which creates a copy of the JAR file in each WAR file, complete the following
steps:

1. Open the Properties dialog of the Web project. Right-click on the project in the Project view and
select Properties. Select the Java EE Module Dependencies item from the left pane, and
then click on the Web Libraries tab in the right pane. The table contains every Java project
available.

© 2009, IBM SWG - 11 - Version 1.0.0 Date: Friday, December 04, 2009
Figure 7: Web Libraries Module Dependencies

2. Select the checkbox beside the project to add it to the WAR file.

Configuring a Java EE Runtime Library


When using Eclipse with the Java EE tooling installed, the Java compiler will not be able to resolve
references to the Java EE APIs unless a target 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.

© 2009, IBM SWG - 12 - Version 1.0.0 Date: Friday, December 04, 2009
Figure 8: Server Runtime Environments

3. Click Add and choose Basic > J2EE Runtime Library.

4. On the next wizard page, click Browse to choose the library location, and locate the
dev/JavaEE folder of your WebSphere Application Server installation and select the appropriate
Java EE version. That folder contains the j2ee.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 on
the project in the Project view and select Properties, and choose the Targeted Runtimes item.

Figure 9: Targeted Runtimes

© 2009, IBM SWG - 13 - Version 1.0.0 Date: Friday, December 04, 2009
Under the runtime listing, select the checkbox next to the recently configured Java EE runtime library,
and click OK.

© 2009, IBM SWG - 14 - Version 1.0.0 Date: Friday, December 04, 2009
Configuring the 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. The scope can be a project, a working set, or the entire workspace. Once defined, you can
save the analysis configuration to use or modify later.

With the migration toolkit installed, you have new analysis options to configure and run an analysis.
You can access the options in the Eclipse Run menu, in the Launch toolbar, and in the explorer
context menus. The following figure demonstrates the different ways you can run the analysis using the
Application Migration Toolkit.

From the Eclipse menu: From the Launch Eclipse toolbar:

From the explorer context menu:

Figure 10: Options for running the tool

If you do not see Software Analyzer options, see the troubleshooting section, Software Analyzer
options not shown, on page 31.

© 2009, IBM SWG - 15 - Version 1.0.0 Date: Friday, December 04, 2009
To configure the analysis using the toolbar, complete the following steps:
1. On the toolbar, select Software Analyzer ( ) > Software Analyzer Configurations… to
display the main configuration dialog.

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

Figure 11: Configuration dialog

2. In the configurations list, select Software Analyzer then click New . The right side of the
dialog changes to show the basic configuration interface.

© 2009, IBM SWG - 16 - Version 1.0.0 Date: Friday, December 04, 2009
Figure 12: Configuration Setup

3. In the Software Analyzer Configuration dialog, enter a name for the configuration, such as
AppMigration as shown in Figure 12: Configuration Setup.

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 selection of projects.
Tip: When you use the explorer context menu to run your analysis, the scope of the analysis is limited
to the node in the project where the context menu 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 (see Figure 13)

To automatically select all of the WebLogic conversion rules, select WebLogic Application
Migration from the Rule Sets menu list, and click Set.

The migration toolkit has rules under the following analysis providers:
© 2009, IBM SWG - 17 - Version 1.0.0 Date: Friday, December 04, 2009
 Class-Path Review
 Java Code Review
 JSP Code Review
 XML File Review

The Rules tab displays a directory tree, where you can select or deselect analysis elements.
This tab also includes additional buttons for importing and exporting rule selections. The nodes
at the beginning of the domain tree are analysis providers, which represent the types of analysis
tools that are recognized by the analysis framework. Providers contain categories which
organize the rules.

See Figure 13 for an example of selected rules.

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

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

© 2009, IBM SWG - 18 - Version 1.0.0 Date: Friday, December 04, 2009
Figure 13: Rule selection
6. To save the rule configuration, click Apply.

Some rules have additional configuration options. When a rule with configuration options is selected,
the rule properties are shown in the Properties tab under the list of rules. Figure 14 shows the rule
properties for a Web services rule. If you do not update the properties, the rule uses the default values.

© 2009, IBM SWG - 19 - Version 1.0.0 Date: Friday, December 04, 2009
Figure 14: Rule Properties

© 2009, IBM SWG - 20 - Version 1.0.0 Date: Friday, December 04, 2009
Running the analysis
Run the analysis and display the results.

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

2. 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 results view might vary. The results generated by the
migration toolkit are displayed in one of four tabs:
 Class-Path Review
 JSP Code Review
 XML File Review
 Java Code Review
Some results views, such as Java Code Review, support viewing results in more than one format. For
example, results can be viewed in a table or a tree format.

Figure 15: Java Code Review results view

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

Right-clicking on individual results gives access to options such as viewing the source code where the
problem occurred or correcting the problem with a provided fix.

© 2009, IBM SWG - 21 - Version 1.0.0 Date: Friday, December 04, 2009
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 of
the 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 this rule has a quick fix.
Selecting this option runs the conversion that modifies the affected Java code, XML file, JSP or
manifest file, allowing it to run in WebSphere Application Server. The quick fix might change
the code directly or it might present the steps needed to complete the fix.

 Quick Fix Preview – This option is available for the rules that support showing a side-by-side
comparison of the original code and the code after the quick fix is applied. This option allows
you to see the changes before they are made. Figure 16: Result options with Quick Fix Preview
and Help shows an example of the quick fix preview. Some quick fixes modify more than one
file. When you select Quick Fix Preview for a fix affecting multiple files, the files are shown in
the Structure Compare portion of the Compare view. Double-click each file to view the
differences. For example, Figure 17 shows the changes that will be made to a web.xml file.
© 2009, IBM SWG - 22 - Version 1.0.0 Date: Friday, December 04, 2009
Figure 17: Quick Fix Preview with multiple files

 Ignore Result – This option removes the rule from the list without making a code change. For
Java files, a comment 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.
Context sensitive help is displayed in the Help view as you select each result. The first panel is a short
description. Click Detailed Help to get more information. Press F1 to open the Help view.

© 2009, IBM SWG - 23 - Version 1.0.0 Date: Friday, December 04, 2009
Completing the process

After correcting the issues highlighted by the migration toolkit by running quick fixes or by making
manual code changes, there are a number of additional rules provided by the Rational Software
Analyzer product that can help improve the quality of your code. These rules are not required for
conversion. Figure 18: Other architectural and Java rules shows examples of the additional rules.

Figure 18: Other architectural and Java rules


Access these rules by creating a new analysis configuration or modifying an existing one. These rules
are not automatically selected as part of the WebLogic Application Migration rule set.

When the selected rules run and necessary changes are made, the updated application must be
exported and tested on WebSphere Application Server. If using Rational Application Developer, there
are tools available to create deployments and test the application within the Eclipse environment.

© 2009, IBM SWG - 24 - Version 1.0.0 Date: Friday, December 04, 2009
WebLogic to WebSphere Application Server rules and quick fixes
The Application Migration Tool evaluates Java code, JSP code, deployment descriptors, and Web
services deployment descriptors as part of its analysis set. This section provides specific details on the
rules and quick fixes provided.

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

Figure 19: Analysis domains

Java code review rules

Under the Java Code Review set of rules, the WebLogic to WebSphere code migration category
contains multiple rules. For more information, press F1 when viewing the rule in the configuration dialog
or in the results viewer.

Rule Name Quick Action Taken


Fix
Do not use UserTransaction No This rule detects references to
interface from CMT beans ctx.lookup(“javax.transaction.UserTransaction”)
within container managed transaction enterprise
beans. References to the UserTransaction object
are not allowed from CMT beans.

These references are flagged so that you can


remove this Java EE violation.
Do not use WebLogic RMI API calls Yes This rule detects the use of references to the
proprietary weblogic.rmi packages.

The quick fix changes weblogic.rmi to java.rmi to use


the Java provided classes.
Do not use WebLogic-specific JNDI Yes Scans Java files detecting the usage of the JNDI
name values name values:

 java.naming.factory.initial=weblogic.jndi.WLI
nitialContextFactory
 java.naming.provider.url= t3://localhost:7001

If found, users are given the option to change the


© 2009, IBM SWG - 25 - Version 1.0.0 Date: Friday, December 04, 2009
JNDI names to default portable JNDI Name values:

 java.naming.factory.initial=com.ibm.websph
ere.naming.WsnInitialContextFactory
 java.naming.provider.url=corbaloc:iiop:local
host:2809
Note: the JNDI Name values must be in the same
java source file where the context is initialized with
the javax.naming.InitialContext(Hashtable)
constructor.
Do not use WebLogic startup or Yes This rule looks for classes that implement the
shutdown classes WebLogic startup and shutdown interfaces.

The quick fix converts these classes to use the


javax.servlet.ServletContextListener interface and
registers it in the application's web.xml file.
Use compliant UserTransaction Yes This rule looks for references to
lookup name ctx.lookup(“javax.transaction.UserTransaction”).

Within bean managed transaction (BMT) beans, the


quick fix converts the flagged line to
ctx.getUserTransaction().

Within servlets, Web applications and client code,


the flagged line is converted to the JNDI lookup:
ctx.lookup(“java:comp/UserTransaction”)
Use matching throws clause in EJB Yes This rule looks for mismatches between the
bean class enterprise bean implementation and the method
definitions in the home and remote interfaces.

The quick fix adds any missing exceptions and


removes any extra exceptions. The interfaces are
not changed.
Use portable JNDI Names No Detects the usage of the constructor:
javax.naming.InitialContext(Hashtable), informing not
to put any proprietary WebLogic JNDI name values
into the Hashtable.
Do not use non-mapping No This rule flags import and code references to classes
weblogic.apache packages where the class package starts with weblogic.apache
and the class does not map to an open source
Apache class.

You must modify the code to use different classes.


See the rule help for more information.
Do not use weblogic.apache Yes This rule flags import and code references to classes
packages where the class package starts with weblogic.apache
and the class maps directly to an org.apache class.

The quick fix changes the code to org.apache.

© 2009, IBM SWG - 26 - Version 1.0.0 Date: Friday, December 04, 2009
Download the appropriate Apache open source .jar
file, and include it with your application.
Do not use WebLogic-specific No This rule flags imported classes that begin with
packages weblogic but not including the weblogic.apache
classes. The flagged server specific APIs must be
migrated.

© 2009, IBM SWG - 27 - Version 1.0.0 Date: Friday, December 04, 2009
JSP code review

Under the JSP Code Review set, the JSP Conversions category has rules described in the following
table. For more information, press F1 when viewing the rule in the results viewer.

Rule Name Quick Action Taken


Fix
Avoid using a .jsp extension for Yes This rule looks for JSP fragments included in another
JSP fragments JSP. If the JSP fragment file has the .jsp extension
rather than .jspf extension, it is flagged.

The quick fix takes you to the refactor dialog to


change the file name and all of its references.
Use correct case for tag attribute Yes JSP taglib attributes are case-sensitive in
names WebSphere Application Server. This rule flags any
taglib attribute that is not case correct.

The quick fix changes the case as it is defined in the


tag library.

XML file review

The XML File Review provides a number of rules to detect deployment descriptors, Web services and
other XML file issues.

Rule Name Quick Action Taken


Fix
Do not use local JNDI names No Select the rule and press F1 for manual conversion
instructions.
Use standard deployment Yes WebLogic-specific deployment descriptors
descriptors for EJB reference (weblogic.xml or weblogic-ejb-jar.xml) might contain
names EJB references. These references map the EJB
reference to the JNDI name. For the references to
work on WebSphere Application Server, they must
be moved to the standard Java EE deployment
descriptors (web.xml or ejb-jar.xml).

The quick fix provided moves all EJB references


defined in WebLogic-specific deployment descriptors
to standard deployment descriptors.
Use standard deployment Yes WebLogic-specific deployment descriptors
descriptors for resource reference (weblogic.xml or weblogic-ejb-jar.xml) might contain
names resource references. These references map the EJB
reference to the JNDI name. For the references to
work on WebSphere Application Server, they must

© 2009, IBM SWG - 28 - Version 1.0.0 Date: Friday, December 04, 2009
be moved to the standard Java EE deployment
descriptors (web.xml or ejb-jar.xml).

The quick fix provided moves all resource references


defined in WebLogic-specific deployment descriptors
to standard deployment descriptors.
Use WebSphere bindings to define No Select the rule and press F1 for manual conversion
JNDI names instructions.
Use WebSphere bindings to define No Select the rule and press F1 for manual conversion
message driven descriptor instructions.
Use WebSphere extensions to No Select the rule and press F1 for manual conversion
define concurrency strategy instructions.
Use WebSphere extensions to No Select the rule and press F1 for manual conversion
define transaction timeout seconds instructions.

The following rule flags any WebLogic unhandled or partially handled XML file:

Rule Name Quick Action Taken


Fix
Do not use weblogic.xml file No Select the rule and press F1 for manual conversion
instructions.
Do not use weblogic- No Select the rule and press F1 for manual conversion
application.xml file instructions.
Do not use weblogic-cmp-jar.xml No Select the rule and press F1 for manual conversion
file instructions.
Do not use weblogic-cmp-rdbms- No Select the rule and press F1 for manual conversion
jar.xml file instructions.
Do not use weblogic- No Select the rule and press F1 for manual conversion
diagnostics.xml file instructions.
Do not use weblogic-ejb-jar.xml file No Select the rule and press F1 for manual conversion
instructions.
Do not use weblogic-ra.xml file No Select the rule and press F1 for manual conversion
instructions.

The WebLogic Web services migration category has the following rule:

Rule Name Quick Action Taken


Fix
Do not use WebLogic Web services Yes This rule looks for the Web services deployment
deployment descriptor descriptor as follows:
 The presence of web-services.xml or
 The presence of weblogic-webservices.xml
and the Java EE deployment descriptor
(webservices.xml) in the same folder.

© 2009, IBM SWG - 29 - Version 1.0.0 Date: Friday, December 04, 2009
The quick fix generates an ANT script that uses IBM
WebSphere ANT tasks, which generates the
appropriate artifacts for the list of Web services
based on the information collected from the
deployment descriptors. Depending on the
deployment descriptor, the fix might also generate
the Service Endpoint Interface (SEI) for the service
and add it to the project class path.

The user can then run the ANT script, copy the
generated artifacts to the project, and possibly add
additional targets such as the endpoint enabler, for
example.

Class path review

The Class-Path Review provider verifies the MANIFEST.MF class path is set up properly.

Rule Name Quick Action Taken


Fix
Use MANIFEST.MF for application Yes This rule looks for any classes or libraries contained
class path within an APP-INF directory of an EAR file.

The quick fix adds an entry to the class path of each


affected Web module by updating the Class-Path
entry of the module's MANIFEST.MF file.

© 2009, IBM SWG - 30 - Version 1.0.0 Date: Friday, December 04, 2009
Troubleshooting
Software Analyzer options not shown
After the Application Migration Tool is installed, you have new Software Analyzer menu and toolbar
options in the Java, Debug, C++, and Plug-in Development perspectives. When using other
perspectives, enable these options manually. To customize other perspectives, complete the following
steps:

1. From your perspective, select Window > Customize Perspective from the Eclipse menu.

2. In the Customize Perspective window, click the Commands tab and select the Software
Analyzer checkbox. If you are running Rational Application Developer, then the Rational
Software Analyzer checkbox might be displayed.

3. Click OK.

Figure 20: Software Analyzer availability

Java EE constructs or JSP not read correctly


For the tooling 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-clicking on the project in the project explorer and selecting Properties.
Select the Project Facets property. Projects containing Web modules must be dynamic Web projects.
See Importing applications in Eclipse on page 9 for more information.

© 2009, IBM SWG - 31 - Version 1.0.0 Date: Friday, December 04, 2009
Logging and trace
The Application Migration Tool writes error information to two log files:

 The workspace log (<workspace>/.metadata/.log) contains our severe error logs as well as
Rational Software Analyzer logs.
 The Application Migration Tool service logs are located in the
<workspace>/.metadata/.plugins/com.ibm.ws.appconversion.base directory.
This log contains all error information as well as detailed trace information if trace is enabled.
Enable the migration tool’s trace by setting the appconversion.trace system variable on the Eclipse
command line or in the eclipse.ini property file. For example:

 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 line 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 view, the analysis provider tabs have buttons used to export selected
analysis history to file and to generate reports. Java Code Review is the only results view that has
support for reports.

For exported history, you can specify the location for the generated result.

For generated reports, the report is displayed when the report is finished. An HTML report is displayed
in a Web browser. You can configure the Web browser under the Eclipse properties for General >
Web Browser.

PDF reports are displayed in the system’s default PDF viewer. The generated files are put in the
<workspace>/.metadata/.plugins/com.ibm.xtools.analysis.reporting/reports directory.

Known Issues

No popup window displays when clicking on the marker

This issue effects non-Java based rules. Figure 21 Error! Reference source not found.shows that
analysis of a Java rule results in a clickable marker in the left margin on line 31. Clicking the marker
displays a pop-up that allows a quick fix action and displays help text.

© 2009, IBM SWG - 32 - Version 1.0.0 Date: Friday, December 04, 2009
Figure 21: Java quick fix marker

Figure 22 shows an example of an XML rule violation that results in a marker on line 11. However,
clicking on the marker has no action, and hovering over the marker only displays the help text.

Figure 22: XML quick fix marker

Solution:
Use the Software Analyzer Results view to select the Quick Fix action in non-Java files.

Double-clicking on a marker in a manifest file removes the marker

Figure 23Figure 23 shows Class-Path analysis results and the file displayed when you view results.
Double-clicking on the marker on the first line removes the marker as shown in Figure 24.

© 2009, IBM SWG - 33 - Version 1.0.0 Date: Friday, December 04, 2009
Figure 23: Manifest file markers

Figure 24: Manifest file after double-clicking on the marker

Solution:
Rerun the class path rule to display the marker again.

Can not 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 must carry out the action of the first marker in order to select successive markers. In
Figure 25, line 24 has multiple segments of underlined text, indicating that there are several markers on
this line.

Figure 25 Multiple markers on a line

Figure 26 shows that hovering over line 24 in the left margin displays a message indicating there are
multiple markers.

© 2009, IBM SWG - 34 - Version 1.0.0 Date: Friday, December 04, 2009
Figure 26: Marker hover help

Figure 27 shows that clicking on the marker on line 24 results in displaying only the first rule’s actions.

Figure 27: Marker actions

When using the marker in the left margin, you must resolve all issues with prior rules before you can
get to successive quick fix actions.

Solution:
Use the Software Analyzer Results view to select the Quick Fix action you want.

Clicking on View Result for XML rules has no highlighted text

When viewing the results of any XML rule, although there is a marker in the left margin, no text is
selected and highlighted.

Solution:
Use the marker in the left margin to view the line causing the rule violation.

© 2009, IBM SWG - 35 - Version 1.0.0 Date: Friday, December 04, 2009
Copyrights and trademarks

.
© Copyright IBM Corporation 2009. All Rights Reserved
The information contained in this publication is provided for informational purposes only. While efforts were made to verify
the completeness and accuracy of the information contained in this publication, it is provided AS IS without warranty of
any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are
subject to change by IBM without notice. IBM shall not be responsible for any damages arising out of the use of, or
otherwise related to, this publication or any other materials. Nothing contained in this publication is intended to, nor shall
have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the 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 all
countries in which IBM operates. Product release dates and/or capabilities referenced in this presentation may change at
any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment
to future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have the
effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth, savings
or 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, including
considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage
configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve
results similar to those stated here.
IBM, the IBM logo, developerWorks, Passport Advantage, Rational, and WebSphere are trademarks of International
Business Machines Corporation in the United States, other countries or both.
Java and all Java-based trademarks and logos are trademarks of Sun Microsystems, Inc. in the United States, other
countries or both.
Other company, product and service names may be trademarks or service marks of others.

© 2009, IBM SWG - 36 - Version 1.0.0 Date: Friday, December 04, 2009
Document change history
Check the date in the footer of the document for the version of the document.

December 4, 2009 Release 1.0.0

© 2009, IBM SWG - 37 - Version 1.0.0 Date: Friday, December 04, 2009

Das könnte Ihnen auch gefallen