2 Minutes To Code (β Version)

Apache Tomcat - 2 minute tutorial

How to configure tomcat to enable its remote debugging

To debug your web application , you will need to attach a debugger to the tomcat's jvm. To enable a debugger to attach to the tomcat's jvm, you need to provide the following java options to the jvm when starting it.

-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

where 8000 is the port that the tomcat's jvm will listen for incoming debugging session requests and debugger should connect to. In tomcat, this can be done in $TOMCAT_HOME/bin/startup.sh or startup.bat file by setting :

JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"

The tutorial explains how to debug a java app using Eclipse debugger.