I'm struggling to debug an application that builds as a Sling bundle. The application is almost entirely Groovy code (I have the Groovy Eclipse plug-in), and Eclipse (using Maven) is building the .jar and installing it in Sling without any problems.
However, it's not able to debug. I have followed instructions to set up remote debugging, which I gather is necessary for debugging Sling apps - specifically, I launch Sling with the following command:
java -Xdebug -Xnoagent -Djava.io.tmpdir=/c/Users/nickgolding1/temp -Xmx1024m -Xrunjdwp:transport=dt_socket,address=30303,server=y,suspend=n -jar org.apache.sling.launchpad-6-SNAPSHOT-standalone.jar -p 8080
First, a suggestion. Set
suspend=y in your Xrunjdwp:transport option. This will suspend in main and will give you a better idea as to whether or not your problem is with your debug options or the Groovy code.
Now, on to something more complicated. Yes. There are some issues regarding debugging of remote Groovy code. The problem generally comes about when Groovy code is loaded dynamically. In this case the debug name often does not match the source name and the debugger does not know how to match the dynamically loaded class file with the original source code.
One such problem is described here (and there are no doubt other places where similar things happen): https://jira.springsource.org/browse/SPR-7113
So, my suggestion to you is that if possible you should ensure that your groovy code is pre-compiled before being sent to the server. (And also set