Debugging Java

When message flow processing has paused at a breakpoint that you have set in source code within a node that contains Java™ code, you can examine and modify the Java variables in the Flow Debugger.

Procedure

  1. To open the Command Console, click Start > All Programs > IBM App Connect Enterprise 13.0.n > IBM App Connect Enterprise Console 13.0.n.
  2. Start the integration node by running the mqsistart command in the Command Console.
  3. Check that the Java debug port is set by running the mqsireportproperties command (all on one line) in the Command Console:
    mqsireportproperties integrationNodeName -e integrationServerName -o ComIbmJVMManager -r
    For example:
    mqsireportproperties TEST -e default -o ComIbmJVMManager -r
  4. Set the Java debug port by running the mqsichangeproperties command (all on one line) in the Command Console:
    mqsichangeproperties integrationNodeName -e integrationServerName 
    -o ComIbmJVMManager -n jvmDebugPort -v port_number
    For example:
    mqsichangeproperties TEST -e default 
    -o ComIbmJVMManager -n jvmDebugPort -v 3920
  5. Stop and restart the integration node by running the mqsistop and mqsistart commands.
  6. Open the message flow that you want to debug in the Message Flow editor by double-clicking its name in the Application Development view.
  7. Add a breakpoint where the Java method is called, by following the instructions in Adding breakpoints in the flow debugger.
  8. To step directly into the Java code during the debugging process, add a breakpoint in the Java code.
  9. Deploy the BAR file that includes the JAR file that contains the Java code, by following the instructions in Deploying integration solutions to a production environment.
  10. Click Run > Debug to open the Debug wizard.
  11. Right-click Debug in the list of elements on the left and click New.
  12. Set the Java Debug Port with the same value that you specified for the -v parameter on the mqsichangeproperties command, and click Apply to save your changes.
  13. Click the Source tab, specify the source file location, and click Apply to save your changes.
  14. Click Debug to start the debug process.

Working with Java variables

About this task

When message flow processing has paused at a breakpoint in the source code within a node that contains Java code (a user-defined node or a JavaCompute node), you can browse Java variables in the Variables view on the Debug perspective, and change their associated data values.

Procedure

  1. Switch to the Debug perspective.
  2. Click the Variables tab to open the Variables view if it is not already open.
    Variables are shown in a tree, using the symbol Variable.
  3. To work with a variable, right-click it and select an option from the menu.

Results

Message flow processing continues until the next breakpoint that is set in the logical processing of the current message. If there is no further enabled breakpoint at which the flow instance can pause, processing runs to completion and the flow instance is removed from the Debug view.

What to do next

When you have completed debugging the message flow, you can remove the breakpoints or end the debugging session: