Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

Step Debugging

There is only that much information that a log output capture: when more run-time context is required, your best option is to step debug into your running Mule development instance.

When Running From Eclipse

Select the "Debug As > Mule Server" start-up mode from your configuration file. Any breakpoint you will have set in your custom code or Mule’s source code will suspend the execution and will take you to Eclipse’s Debug perspective.

When Running Mule Standalone

You need to start Mule with the -debug to activate remote debugging, which gives (on Linux):


         
      
1
$MULE_HOME/bin/mule -debug

With this option, Mule will start normally with the only difference being the following message logged in the console:


         
      
1
Listening for transport dt_socket at address: 5005

Mule is now remote debuggable on port 5005. Should you want to use another port or configure the JVM to ponder until a remote debugger gets attached, edit the mule start-up script that is relevant for your operating system and change the parameters found in the JPDA_OPTS property.

Switch to Eclipse and go the the Run > Debug Configurations menu. From there, create a Remote Java Application configuration. Ensure the port is 5005.

Also, in order to step debug with the source code attached, you need to add the source code of your Mule local instance as an external archive on the second tab of the configuration panel.

You are now ready: click the Debug button at the lower right corner of the configuration screen: the local Mule instance will resume its start-up sequence and soon you’ll be ready to step debug.