Start Tomcat in Debug Mode

1)In the eclipse window, click on the debug icon, select "Remote Java Application" from the list of configurations. Right click on the "Remote Java Application" and create a new configuration for your application.

On the right hand side, there will be three tabs, namely "Connect" ,"Source" and "Common". Click on the "Connect" tab and set the connection properties, host as "localhost" and port as "8000".

2) In the enviornment variables, add an entry jpda_address=8000;This is the default connection port used by eclipse when you try to connect to a remote VM for debug.

3)Open catalina.bat (inside the bin folder of tomcat) and search for "set JPDA_TRANSPORT". Set the value to dt_socket.

4)Open startup.bat(inside the bin folder of tomcat) and search for call "%EXECUTABLE%" start %CMD_LINE_ARGS%. Its at the end of the file. Replace this with call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS% (mind the spaces, better copy and paste).

5)Save the changes and start the tomcat server using its startup.bat file. The first line appearing on the server window should be "Listening for transport dt_socket at address: 8000. This indicates that all is well..:-). Go to eclipse debug perspective, add breakpoints and start debugging...:-)

Comments

Popular posts from this blog

Step by step guide on how to pay Income Tax that is due

Simple way producer–consumer problem's implementation in NodeJs

Rajiv Gandhi Equity Savings Scheme