Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Prevent NetBeans term from turning into a link. Updated Jasper phrase wording.

...

Anchor
Q3
Q3
How do I remotely debug Tomcat using NetBeans?

This answer assumes that you have correctly set up a NetBeans project and that you know how to use the NetBeans debugger. If not, please go to http://www.netbeans.org/kb/using-netbeans/40/debug.html and read up on how to use NetBeans and its debugger.

Make sure that Tomcat is started in debug mode as described above, that your application is deployed, and that the sources are all defined as resources in your application. If you have a servlet or JSP file, set a breakpoint where you think a problem might be occurring. Go to "Run->Attach Debugger". A dialog pops up to let you specify the following options:

  • Debugger: JPDA Debugger
  • Connector: SocketAttach
  • Host: The IP address of the host your Tomcat installation is running on (127.0.0.1 if it is your local machine).
  • Port: The port of your Tomcat debugging interface, which should be 8000 if you've followed the instructions above.

When you press OK, you have a debugging connection very similar to local debugging.

Note that NetBeans has a second option – you can debug JSP files and servlets locally using a Tomcat server that is bundled with the IDE. When you debug a JSP file or servlet in the IDE, the bundled Tomcat server automatically starts in debug mode, and the debugger connects to it.

...

Monitoring interval for application reloading is controlled by the backgroundProcessorDelay property on Context element or on its parent containers: Host and Engine. See Tomcat Configuration Reference. By default there is a single backgroung processing thread that run by Engine. See its configuration for the default delay value.

Monitoring intervals for the Interval that controls reloading of the changed JSP pages are is set in the Jasper servlet configuration in web.xml.