Debugging Tomcat is no different than
debugging any other Java remote application. You need to make sure to
launch it with the required debugging arguments and attach a
debugger. In the case of Tomcat, you need to add these arguments to
the startup script.
We need to change
catalina.bat/catalina.sh located under TOMCAT_HOME/bin.
Open catalina.bat/catalina.sh under
TOMCAT_HOME/bin directory in your project domain.
Inside that just set the debug option
code shown below with port number.
Once the JAVA_OPTS is set open your
project in Eclipse.
From debug icon click on debug
configuration and the remote java application.
Specify the debugger name and project
name for which you want to set debugger.
The port number should be same as one
you set incatalina.bat/catalina.sh.
Once done your are ready to debug.
set some breakpoints in your
application and start Tomcat server.
Once the debugger starts you can
navigate between consecutive breakpoints using F6 and F8 for juming
from one BP to another
DEBUG_OPTS = -Xdebug -Xrunjdwp:transport= dt_socket,address=1044,server=y,suspend=n DEBUG_OPTS = -Xdebug -Xrunjdwp:transport= dt_socket,address=1044,server=y,suspend=n