Running Tomcat with remote debugging enabled
- deploy the application you need to debug as usually
- start Tomcat by executing the catalina.bat script and providing the "jpda" argument
Then, all you need to do is to create a remote Java application in Eclipse through these few steps :
1° Open the debug configurations
2° Create a new Remote Java application :
3° Specify the project you're debugging (in my example, I've configured remote debugging for one on my sample projects, named "Blog - Remote Tomcat debugging")
4° Specify the host on which the application to debug is deployed
5° Specify the port that is opened for debugging purpose (same as the one configured as JPDA_ADDRESS in the catalina.bat file from Tomcat)
6° Launch the Remote application by clicking on "Debug"
At this point, you could set breakpoints wherever you want in the project's source code and if the code marked with your breakpoints is executed, the running thread will be suspended and you'll be able to watch variables' value, execute expression, and so on.
