How to debug Fuse ESB sessions in Eclipse or JBoss Developer Studio

Solution Verified - Updated -

Environment

Red Hat JBoss Fuse 6.1.0
JBoss Developer Studio (JBDS)

Issue

I am using JBoss Developer Studio Version: 7.1.1.GA, with Fuse Integration plugin.
I can start Fuse from IDE, and I set couple of breakpoints in InsurerServiceImpl.java but execution does not stop at set breakpoints. Please provide steps to make execution stops at breakpoints.

Resolution

To enable remote debugging for Apache ServiceMix, the environment variable KARAF_DEBUG=true should be set.

On Windows run:

set KARAF_DEBUG="Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"

On Unix/Linux run:

export KARAF_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"

Once the environment variable is set, start JBoss Fuse. You should now notice the following output when the ESB starts:

Listening for transport dt_socket at address: 8000

From JBDS, right click on the project you wish to debug and select Debug As > Debug Configurations. Then create a new Remote Java Application and enter the project name, host, and port JBoss Fuse is using, port 8000 is the default. Then click Debug.

Root Cause

If you are using the Integration Stack JBoss Developer Studio plugin, you should be able to start the Fuse container in debug mode from the server tab.

However due to a bug in the current version < 7.3, you can't do it. It will be fixed in version 7.3.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments