Tomcat plugin debugging not working

(Petr Osipov) #1

Tried to set up everything as described here for question How do I remote debug my Tomcat started up by the plugin?

I. Set property in ~/.bashrc on

GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=29999"

II. in a folder of my project using tomcat plugin ran

gradle tomcatRun

Result I can connect to port 29999 when gradle build is being executed, but then VM dies and trying to reconnect fails, even though tomcat is indeed running.

Problem analysis This to me indecates that GRADLE picks up the debug parameter instead of passing it to tomcat’s plugin JVM. The same problem is with Jetty plugin.

System parameters OS: Ubuntu 11.04 - the Natty Narwhal

Gradle: 1.7 Java: 1.6.26 Tomcat: 7.0.42

(Petr Osipov) #2

Was able to get debugging working only with

(Benjamin Muschko) #3

This should work for the Jetty and the Tomcat plugin. Both plugins use an embedded container implementation that runs in the same JVM as Gradle. Do you see the following output when executing tomcatRun?

Listening for transport dt_socket at address: 29999

(Petr Osipov) #4

Thank you for the replay, Benjamin. Yes, I do see it and actually able to connect to a JVM, but breakpoints do not work. It might an issue with our custom eclipse plugin.

(Benjamin Muschko) #5

I just verified that breakpoints work in IntelliJ. You might want to try the setup without your custom plugin or a fresh Eclipse distribution.

(Petr Osipov) #6

Right. Okay. We cannot throw away the custom eclipse plugin at this point, but will not loose hope on this plugin in the future then.