It's part of the provisioning of the container, org.ops4j.pax.exam.CoreOptions.vmOption
Eclipse can do it, too, obviously, but I don't know how. It was extremely simple in Intellij - Eric L On Sat, Nov 11, 2023 at 6:25 PM Steinar Bang <[email protected]> wrote: > (hm... I never responded to this one, looks like...? Sorry about that!) > > >>>>> Eric Lilja <[email protected]>: > > > Yeah, as JB mentioned, Karaf mode in Pax Exam is forked so the classpath > > from the test bootstrap itself does not spill over into the container > (for > > native pax exam, you can choose between forked mode or not). > > > Anyway, remote debugging seems to be a bit easier in Intellij (I stopped > > using Eclipse several years ago). Remote debugging is turned on by adding > > the following VM option (regardless of IDE, obviously): > > > vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005") > > I think this is why I didn't respond: I couldn't figure out where this > vmOption was to be added, and thought "postpone figuring this out for > later!"... and then forgot...:-) > > Is this vmOption added to whatever VM runs the pax exam test? > > And what happens then is that the test is hanging until a debugger > attaches itself to port 5005? > > > Then when the test is launched in debug mode, Intellij emits: > > Listening for transport dt_socket at address: 5005 > > Right! Looks like that is the case. > > > And next to that log statement, there is something akin to a button that > > says "Attach debugger", which I can just click to be able to debug the > > container (it takes a few seconds to attach). > > Hm... wonder if eclipse can do that? > > (I use IntelliJ at work, but I've never really warmed to it.) > > > No need to create a special debug configuration > > > However, I did notice that all log output from then on doesn't seem to > > appear anywhere, which is a bit annoying, but I'm sure that can be > > resolved. Inspecting all objects etc, which is the important stuff, works > > fine, however. > > Sounds promising! Thanks! > > (I'll try to figure out where the vmOption goes and then if eclipse can > attach to a hanging test) > >
