Debugging the Application

You can debug both the JVM COBOL and Java code in the same process.
  1. Set a breakpoint in the JVM COBOL code:
    1. In the Navigator, choose TemperatureConverter > src > com > microfocus > converter > TemperatureConverter.cbl.

      The JVM COBOL business logic appears in the main pane.

    2. Double-click the marker bar to the left of the compute statement in the toCelsius method.

    The breakpoint is set.
  2. Set a breakpoint in the Java code:
    1. In the Navigator pane, choose TemperatureConverterEJB > ejbModule > com > microfocus > businesslogic > TemperatureConverterBean.java.

      The Java code appears in the main pane.

    2. Double-click the marker bar to the left of the c declaration in the toCelsius method.

    The breakpoint is set.
  3. Right-click TemperatureConverterPrj, then choose Debug As > Debug on Server.

    The Debug on Server dialog box appears.

  4. Click Finish.

    If the server is not already running, it is started.

  5. Navigate to the following URL:
    http://localhost:8080/TemperatureConverterPrj/RestApp1/getCelsius?fahrenheit=212
  6. If you are prompted to switch to the Debug perspective, click Yes.

    The breakpoint is hit and execution breaks in the Java program. At this point, you can step through the program as normal.

  7. Press F8 to resume execution.

    The compute breakpoint is hit and execution breaks in the JVM COBOL program.

  8. Continue debugging, or press Ctrl+F2 to terminate.