Remote Debugging Tomcat 6 using SSH tunnel

My current IDE is Intellij Idea 12 and it is running on Windows 7 machine. However, server exist on one of the RedHat Enterprise machines. The main challenge is to debug the remote tomcat server via SSH port 22 only because that is the only allowed path. Even I cannot ping the server.

Instead of catalina.sh, I have to always run the "sudo service tomcatx start|stop" because tomcat is installed as a service using redhat yum. From this blog I found the details to setup the tomcat. I changed the TOMCAT_HOME/conf/tomcat6.conf file to have the following JAVA_OPTS

JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=15005,server=y,suspend=n"

This is just a one line.

As shown in the above, the port is address that is 15005. Now I have to create the SSH connection using Putty as shown in the below

source port: 15005
Destination: localhost:15005

After add as shown in the above screenshot, you have to start the session. 

Now you have to configure the new remote debugging session in the Intellij Idea 12.0.6.

Now you are ready to debug the remote tomcat server.
However, currently I am facing a problem that is :
"each time I need to restart the server, I have to remove the above JAVA_OPTS line from the tomcat6.conf file". After I stop the server, again insert the line and start the server.  

Comments

Popular posts from this blog

How To: GitHub projects in Spring Tool Suite

Spring 3 Part 7: Spring with Databases

Parse the namespace based XML using Python