Contact Us 1-800-596-4880

Debugging Outside Studio

This version of Mule reached its End of Life on May 2, 2023, when Extended Support ended.

Deployments of new applications to CloudHub that use this version of Mule are no longer allowed. Only in-place updates to applications are permitted.

MuleSoft recommends that you upgrade to the latest version of Mule 4 that is in Standard Support so that your applications run with the latest fixes and security enhancements.

To troubleshoot a Mule app in Anypoint Studio, you can use the Studio Visual Debugger. This lets you set breakpoints to stop execution and check events.

If you’re creating your Mule app outside of Studio, you can either use MUnit to test your app, or you can activate remote debugging.

Use MUnit to Test an App

MUnit is a Mule application testing framework that allows you to build automated tests for your integrations and APIs. It provides a full suite of integration and unit test capabilities, and is fully integrated with Maven and Surefire for integration with your continuous deployment environment.

For more information, see the MUnit documentation.

Activate Remote Debugging

You can start Mule with the -debug option to activate remote debugging, as shown in this Linux example:

$MULE_HOME/bin/mule -debug

With this option, Mule starts normally and logs the following message in the console:

Listening for transport dt_socket at address: 5005

Mule is now remotely debuggable on port 5005. Follow these steps to debug Mule:

  1. Access Eclipse, and select the the Run > Debug Configurations menu. From there, create a Remote Java Application configuration that uses port 5005.

  2. Add the source code of your Mule local instance as an external archive on the second tab of the configuration panel.

  3. Click the Debug button at the lower right corner of the configuration screen. The local Mule instance resumes its start-up sequence and you can debug the app step-by-step.

If you want to use a port other than 5005, change the JPDA_OPTS property file in the Mule startup script before following the steps for debugging Mule.