Hi,

I have encountered an error while trying to use the stop script in order to
shut down my Karaf instance (2.2.6) with the debug option enabled.
More precisely the error was the following:

karaf: Enabling Java debug options: -Xdebug -Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized
[../../../src/share/back/debugInit.c:690]
FATAL ERROR in native method: JDWP No transports initialized,
jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
Aborted

The problem is that stop script calls karaf script which tries to execute a
new Java process with DEBUG option enabled to the same port.
Attached you can find the diff of the karaf script patched to ignore the
setDebugOptions function in case of stop argument.

If you find it useful I can open a jira.

Thanks,
Nikos
43,49d42
< #
< # Check the mode that initiated the script
< #
< if [ "x$1" != "x" ]; then
<     MODE=$1
< fi
< 
230,232d222
<     if [ "x$MODE" = "xstop" ]; then
<         return
<     fi

Reply via email to