Previous Topic Next topic Print topic


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. Ensure that JBoss AS 7.1 is selected and click Finish.

    You receive a notification that the server is not running in debug mode.

  5. Ensure Switch mode (will restart if necessary) is selected and click OK.
    The server is restarted in debug mode. A browser window is opened in the IDE, showing the following URL:
    http://localhost:8080/TemperatureConverterPrj/
    . You can ignore the HTTP Status code message. EJB does not have a landing page and you need to enter the URL for the application manually.
  6. In the browser window, load to the following URL:
    http://localhost:8080/TemperatureConverterPrj/RestApp1/getCelsius?fahrenheit=212
  7. 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.

  8. Press F8 to resume execution.

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

  9. Continue debugging, or press Ctrl+F2 to terminate. You can click COBOL in the right upper corner of the IDE to switch back to the COBOL perspective.
Previous Topic Next topic Print topic