Debugging an Application

This topic explains how to debug an application.

Note that because of the possibility of name space collisions, you can only debug JSPs in one web application at a time. For details on switching projects when debugging JSP's see Special Considerations When Debugging JSPs.

You can debug Java classes from EJB and Utility projects deployed to the same server, regardless of which project is selected for debug, because name space collisions does not occur with Java classes in different projects.

Before you debug an application, you must define a server and add the application to it. Follow the instructions below for individual server types.

If you are deploying an EAR project that contains multiple web applications, you must update your server definition to specify WAR deployment (not the default "exploded" mode) before debugging your project/application. Click the link for your server (below) for instructions on specifying WAR deployment:

Once your server is defined, to debug an application, choose Run > Debug. The following dialog is displayed.

  1. Choose the server from the list of defined servers under J2EE Server.
  2. Choose the project to debug.
  3. Click Apply to save changes.
  4. Click Debug to start the server and run the application.

Once the debugger launches, Debug perspective will open.

Extended Debugger Features

For information on using the Eclipse debugger, consult Help > Help Contents > Java Development User Guide. The Workshop family of products extends the Eclipse debugger to provide the following additional features.

JSP Variables View

The JSP Variables view (available in the Debug perspective) shows the variables accessible by this page regardless of their origin (JSP page, Struts action, and so forth). This saves you time looking for the variables you are using in the page in the application server-specific maps.

It has five categories:

JSP Breakpoints

JSP breakpoints can be added, removed, enabled or disabled from the vertical ruler of the Workshop editor either by double-clicking on a line or by using the context menu.

JSP breakpoints can be set at the following locations:

JSP Stepping

The JSP debugger can step through the JSP source or through the server generated Java source. In JSP mode the stepping commands are declared as follows:

Step Over

The JSP debugger will step over the following elements:

Step Into

Step Return

Step return works exactly like the Java equivalent.

The server generated Java source behind the JSP page can be seen by selecting the "Show Java Source" inside the Debug View pull down menu. When in the mode the debugger steps over the Java lines.

Special Considerations When Debugging JSPs

Related Topics

Running an Application


Still need help? Post a question on the Workshop newsgroup.