Java – How to remotely debug the webapplication running on tomcat service

javatomcat6

I have my webapplication on tomcat 6 at serverA. I am running the tomcat as service i.e thru tomcat6w.exe lying under <tomcat_home>/bin folder. To remotely debug the
weabbplication i have added below lines as suggested on different blog/sites on web in different line witout space at end. Mentioned the port as 8443 as application is running on same port.

-Xdebug-Xrunjdwp:transport=dt_socket,address=8443,server=y,suspend=n

Now thru eclipse on server B i mentioned host as serverA and port 8443 and click debug. After 2-3 minutes it establishes connection without giving any error.But now
when i hit webapplication url in IE it does not show up and says IE can not display the webpage. But as soon as i remove the above mentioned debug parameters
and hit the url, application works fine. I am not getting how should i debug the application when tomcat is running as window service?

For Information Below are the parameters when i double click the tomcat service

--   Under java tab 
--jvm section value  
 C:\Program Files\Java\jre6\bin\client\jvm.dll

--java classpath section value  
 C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin\bootstrap.jar

--java options section value  
 -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 6.0
 -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 6.0
 -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 6.0\common endorsed
 -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 6.0\temp
 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
 -Djava.util.logging.config.file=C:\Program Files\Apache Software 
  Foundation\Tomcat6.0\conf\logging.properties-XX:MaxPermSize=512M
 -Djavax.net.ssl.trustStore=c:/.keystore
 -Djavax.net.ssl.trustStorePassword=changeit-Xdebug 
 -Xrunjdwp:transport=dt_socket,address=8443,server=y,suspend=n  

--Under startup tab

--class section value  
org.apache.catalina.startup.Bootstrap

--workingpath section value  
 C:\Program Files\Apache Software Foundation\Tomcat 6.0

--arguments section value  
 start

--mode section value  
 jvm

Best Answer

In the Java Options tab add the below. Remember to put

-Xdebug 

and

-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8733

in SEPARATE LINE.

-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8733
Related Topic