This page explains how to set up remote-debugging of ServiceMix using Eclipse.
Basically, you have to perform the following steps:
- Enable remote debugging in
servicemix.bat
- Specify a remote-debugging launch configuration
- Start SM and switch to Debug-Perspective
Enable remote debugging in ServiceMix
In servicemix.bat
look for the following section:
if "%SERVICEMIX_DEBUG%" == "" goto :SERVICEMIX_DEBUG_END rem Use the defaults if JAVA_DEBUG_OPTS was not set if "%JAVA_DEBUG_OPTS%" == "" set JAVA_DEBUG_OPTS=%DEFAULT_JAVA_DEBUG_OPTS% set "JAVA_OPTS=%JAVA_DEBUG_OPTS% %JAVA_OPTS%" call :warn Enabling Java debug options: %JAVA_DEBUG_OPTS% :SERVICEMIX_DEBUG_END
... and comment out the first line (rem
).
Specifying a Remote Debugging Launch Configuration
Specify an Eclipse Remote Java Application debug launch configuration on the project you want to monitor.
- Open
Run - Debug
- Mark
Remote Java Application
- Create a
New Launch Configuration
- Specify a name, the project you want to debug (e.g.
servicemix-wsn2005
) and the connection properties. Apply
.
See http://www.onjava.com/lpt/a/6174 for details.
Performing Debugging
- Add breakpoints/debug information to the relevant code inside Eclipse.
- Start ServiceMix.
- Start debugging with the previously created launch configuration.
- Switch to debug perspective.
- Exercise the error-causing behaviour.
- Wait for Eclipse to be notified of the breakpoints.