Hear from Salesforce leaders on how to create and deploy Agentforce agents.
Contact Us 1-800-596-4880

Debug Your Application on a Remote Mule Instance from Studio

You can debug your Mule applications deployed on a remote Mule instance using the Studio debugger.

Remote debugging does not work with clusters.

Prerequisites

  • Add the Mule Debugger Mule Server plugin to your Mule instance.
    Because Mule runtime engine 4.x does not include the remote debugger plugin as it did in previous versions, you must manually move the bundled debugger plugin from the embedded Mule runtime engine in Studio, and move it to your remote Mule instance.

    1. Locate the plugins embedded with Anypoint Studio.

  • Windows
    Navigate to the /plugins/ directory in your Studio’s installation directory.

  • MacOS
    Navigate to your Studio installation in /Applications/, right-click on it, select Show Package Content, and navigate to Contents/Eclipse/plugins/.

  • Linux
    Navigate to the /plugins/ directory in your /usr/lib/anypointstudio/ directory.

    1. Navigate to the org.mule.tooling.server.4.x.x.ee_7.x.x.xxxxxx/mule/server-plugins/ directory.
      The org.mule.tooling.server.4.x.X.ee_7.x folder name varies depending on your installed Studio version and build ID.

    2. Copy the mule-debugger-mule-server-plugin folder and paste it in the MULE_HOME/server-plugins directory of your remote Mule instance.

  • You must start your application

  • You must export and deploy your application to the desired instance before accessing and debugging your application on a remote Mule instance.

Start Your Remote Mule Instance in Debug Mode.

Mule runtime engine takes the following parameters to start in debug mode:

-M-Dmule.debug.enable=true

Sets debugging mode in Mule.
This parameter is mandatory and you must use it before any other parameters.

-M-Dmule.debug.port=<port number>

Sets the listening port for incoming connections from Studio. If not set otherwise, the default listening port of 6666 is used.

-M-Dmule.debug.suspend=true

Sets Mule to start and then immediately suspend application execution until it receives a connection on the debug port.

To start Mule in debug mode, use these parameters in either of the following two ways:

  • Pass the debug parameters when starting Mule.

    Pass the debug parameters to the Mule runtime engine on the command line in the following appropriate order:

    <$MULE_HOME>/bin/mule start -M-Dmule.debug.enable=true -M-Dmule.debug.port=1234
    text
  • Configure the debug parameters in the Mule configuration file.

    You can include the parameters in the wrapper configuration file located in $MULE_HOME/conf/wrapper.conf:

    wrapper.java.additional.4=-Dmule.debug.enable=true
    wrapper.java.additional.5=-Dmule.debug.port=1234
    text

When you start Mule in debug mode all applications that you launch in that server run in debug mode.

Configure Studio to Debug your Application in a Remote Mule Instance

  1. In Studio, click Run > Debug Configurations.

  2. In the window’s left pane, click Remote Mule Application.

  3. Click the new configuration icon.

  4. Enter the required parameters for the configuration:

    • Name: specifies the name for this configuration.

    • Host: indicates the location of the remote Mule server.

    • Port: indicates the listening port for the remote Mule server.
      This must be the same debug port that you configured in your Mule instance.

  5. Click Debug.