The debugger enables you to detect and diagnose errors in your
application. It allows you to control the execution of your program by setting
breakpoints, suspending threads, stepping through the code, and examining
the contents of the variables. You can debug an enterprise bean in the WebSphere® test
environment or on a WebSphere server. (Tomcat does not support EJB
testing and publishing).
To debug an enterprise bean:
- In the Navigator view, open your enterprise bean. (You
must have already generated EJB deployment code). The bean opens in the editor.
- To set one or more breakpoints in the editor, double-click in the
margin beside the line of code that you want to set as a breakpoint.
- Ensure the project is associated to run on a server and configuration.
- From the bean's context menu in the Navigator view, click Debug
on Server. The Universal Test Client opens.
- In the left pane, under the EJB Beanss node, expand the bean. Expand the bean's home interface and click the method containing the
breakpoint. The method appears in the right pane.
- In the right pane, click the Invoke button.
- In the Results pane, click the Work with Object button
to get the remote interface.
- In the left pane, expand the bean's remote interface and click
the method.
- In the right pane, type any values for the parameters in the Value
field and click the Invoke button.
- When the breakpoint is hit, the Debug view opens. Step
through the code, inspect and display variables, and make any necessary changes
to the bean. For detailed information on debugging, refer to the online help.
- Save the bean.
- If you have hot method replace enabled, your changes are already
in the running application.
For WebSphere Application
Server, the server will automatically reload the changes and restart the EAR.
The server recognizes your changes.