Tuesday, June 21, 2011

debugging Apache Tomcat 6 webapps in eclipse

Its sometimes useful to run the java webapp in a tomcat container external from eclipse.
This way the eclipse source lookup bug
(not finding the sources in the maven repository) can be avoided.

The default tomcat installer leaves this nifty little manager to control the service.


In order to debug the tomcat jvm as an external java application you need add some properties to the java options to fire up tomcat.

The options have to be added one per line to work!

I use the following combination to permit remote debugging access on 8789
and access to jvm analysis with jvisualvm on port 8888

-Xdebug
-Xnoagent
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8789
-Dcom.sun.management.jmxremote.port=8888
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false

This way the source lookup via maven repository is working splendid.

No comments: