Pages

Sunday, January 11, 2015

Remote debug in Tomcat

As developers we always need to debug the application, Please see below the simple steps to enable remote debug in apache tomcat. Here I am using Mac OS X. You can use same steps in Linux environment.

1. Open Terminal window and Set CATALINA_OPTS environment variable. Execute following command.

export CATALINA_OPTS="-agentlib:jdwp=transport=dt_socket,address=1043,server=y,suspend=n"


2. Goto <Tomcat_home>/bin and execute below command.

./catalina.sh run

3. Open required project from IntelliJ IDEA. (You can use other IDE such as Eclipse)

4. Go to Run->Edit Configurations


4. Add Remote debug by Clicking + and Remote


5. Change debug port to 1043 and click Apply and Debug


Thats all, you can add required breakpoint and debug the application.

Cheers. Hope this will help you all.



No comments:

Post a Comment