ops4j / org.ops4j.pax.construct

Build, manage and deploy many types of OSGi bundles
https://ops4j1.jira.com/wiki/display/paxconstruct/Pax+Construct
24 stars 14 forks source link

Unable to setup remote debugger [PAXCONSTRUCT-134] #54

Open ops4j-issues opened 14 years ago

ops4j-issues commented 14 years ago

Caspar MacRae created PAXCONSTRUCT-134

Hi,

From my pax construct project's top level POM, I have the following pax runner parameters defined:


                        <param>--platform=felix</param>
                        <param>--org.osgi.framework.bootdelegation=javax.*, com.sun.*, sun.*</param>
                        <param>--profiles=log,felix.config,felix.ds,felix.event,war,web,felix.webconsole</param>
                        <param>--shell=gogo</param>

When I try to add the remote debugging line:


                        <param> --vmo="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8787"</param>

I get:


Exception in thread "main" java.lang.NoClassDefFoundError: "-Xdebug
Caused by: java.lang.ClassNotFoundException: "-Xdebug
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: "-Xdebug.  Program will exit.

Noticing the leading quote on -Xdebug I tried alternate single quotes and XML quotes and wrapping that param line in CDATA, all to no avail.

I tried downgrading the pax-runner using mvn pax:update -Dversion=1.3 (which incidentally slightly mangled my POM - a repository <url> tag with CDATA was removed and whitespace reformatted), running the project caused an unidentified null pointer exception so I rolled forward to 1.4 (same POM mangling occurred).

I've tried adding the params --executor=inProcess with --absoluteFilePaths, in this case I don't get the NoClassDefFoundError error but am unable to attach the debugger (and with the suspend flag set to true, it doesn't suspend so am guessing it's ignored).

I don't think this is a problem with the underlying pax-runner as I can launch the cmd line script version with the -Xdebug parameter no problem, so as a possible workaround I'd be eternally grateful if someone point me to the documentation or could tell me how (and i'll wiki it) to get the standalone pax-runner.sh to run my pax-construct project.

thanks.


Affects: 1.4 Votes: 0, Watches: 1

ops4j-issues commented 13 years ago

Andreas Pieber commented

Mhm, can you try to use exactly the following command:

<param>--vmOptions=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005</param>

this works for me