Enable your code and application server for debugging
For debugging purposes, it is recommended that you create a separate application server instance and deploy your enterprise application into it. This way you do not impact the execution of other applications.
Perform these steps to enable your enterprise application and application server for debugging:
- Compile the Java source code specifying the -g option, as shown in this example:
javac -g MyServlet.javaUpdate your enterprise application with the debug-enabled class files, and deploy the application in an application server.
- Enable the application server running the code you want to debug for remote debugging. To enable the application server for remote debugging, follow these steps:
- Start the administrative console.
- Expand Servers and click the Application Servers link.
- Click the link for the application server running the code you wish to debug.
- Select the Configuration tab.
- Scroll down to the Additional Properties section and click the Process Definition link.
- In the Additional Properties section, click the Java Virtual Machine link.
- Check the Debug mode checkbox.
Generally you do not need to modify the Debug arguments field. However, if you are debugging code running in multiple application servers on the same iSeries server you may need to modify the address argument so that it is unique for each application server. This argument specifies the debug port value. It is the last argument in the Debug Arguments field.- Click the OK button.
- Click the Save near the top of the page. On the resulting page, click the Save button.
If the application server is running, stop it.
Start the application server.