The procedure really is very very simple, and following writeup might help someone in similar situation.
- Deploy your war file in Tomcat
- Test the deployed application works in non-debug mode using web browser
- Start Tomcat in debug mode by following steps mentioned below
- Set the following paramters in environment
- Start Tomcat as C:\Apps\Apache\Jakarta\Tomcat\bin>catalina.bat jpda start
C:\Apps\Apache\Jakarta\Tomcat\bin>env | grep -i jpda
- In debug dialog create new 'Remote Java Application'.
- Set host to where Tomcat is running and port to JPDA_ADDRESS
- Set breakpoint whereever you need to and take action to execute that code path.
- That's all there is to it.
For some reason, JPDA_ADDRESS value was ignored in startup, you can cross check that by the logging @startup of Tomcat