WAS v8.5 > TroubleshootDebug applications
- Fire up an IDE like IBM Rational Application Developer and create a project...
New Project dialog | Java | Java Project | Next | DebugProjName | Finish
- Import the recalcitrant application...
File | Import | File System | /path/to/installedApps/node_name/MyBadApp.ear/MyBadWebApp.war | Finish
- Add any JAR files needed to build to the Java Build Path.
Go to...
Properties (right-click) | Java Build Path node | Libraries tab | Add External JARs
...and add...
profile_root/installedApps/node_name/MyBadApp.ear/Increment.jar.
- Use the Attach Source function to attach the Increment.jar file (which contains both source and class files).
- app_server_root/dev/JavaEE/j2ee.jar
- app_server_root/plugins/com.ibm.ws.runtime.jar
- app_server_root/plugins/com.ibm.ws.webcontainer.jar
Click OK when we have added all of the JARs.
The inspect and display features in the source view do not work if the source has build errors. These features let you select an expression in the source view and evaluate it.
- To start debugging, start the WAS in debug mode and make note of the JVM debug port.
The default value of the JVM debug port is 7777.
- When the server is started, switch to the debug perspective by selecting...
Window | Open Perspective | Debug
We can also enable the debug launch in the Java Perspective by choosing Window > Customize Perspective and selecting the Debug and Launch checkboxes in the Other category.
- Create a new configuration.
Debug pushbutton | WebSphere Application Server Debug | New
- Give your configuration a name and select the project to debug (your new DebugProjName project). Change the port number if you did not start the server on the default port (7777).
- Click Debug to start debugging.
- Load one of the examples in your browser. For example:
http://your.server.name:9080/hitcount
Subtopics
- Debugging components in the IBM Rational Application Developer for WebSphere
- Debugging Service details