Debugging an enterprise bean on a server

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:

  1. In the Navigator view, open your enterprise bean. (You must have already generated EJB deployment code). The bean opens in the editor.
  2. 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.
  3. Ensure the project is associated to run on a server and configuration.
  4. From the bean's context menu in the Navigator view, click Debug on Server. The Universal Test Client opens.
  5. 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.
  6. In the right pane, click the Invoke button.
  7. In the Results pane, click the Work with Object button to get the remote interface.
  8. In the left pane, expand the bean's remote interface and click the method.
  9. In the right pane, type any values for the parameters in the Value field and click the Invoke button.
  10. 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.
  11. Save the bean.
  12. 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.

Terms of use | Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.