Debugging your Java application remotely

You can debug a Java™ application that executes a ruleset remotely on a remote virtual machine.

Procedure

  1. After building your project, copy the .CLASS files or .JAR files to the appropriate location on the remote computer.
  2. Call the Java program on the remote computer by using the appropriate VM arguments to specify debug mode and a communication port for the debugger.
    1. Use the following JPDA flags to launch the remote application so that you can call a debugger via a socket on the specified port: -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket, server=y, suspend=y, address=7777. For more information, see Java Platform Debugger Architecture (JPDA).
    2. Set the flag -DIlrEclipseDebugger=true in the command line or activate the debugger in your code by using the engine.setDebuggerActivation(true) API.
      Note: The engine.setDebuggerActivation(true) API is available only for the classic rule engine.
  3. Open Rule Designer and debug your Java application with rules remotely:
    1. Click Run  > Debug Configurations.
    2. Under Remote Java Application with Rules, select the launch configuration that you created, and click Debug.

Results

The launch configuration tries to connect to a VM at the specified address and port, and the result is displayed in the Debug view. If the launcher is unable to connect to a VM at the specified address, an error message is displayed.