Skip to content

Latest commit

 

History

History
83 lines (46 loc) · 2.53 KB

debug-an-application-running-on-sap-jvm-ef7fbdb.md

File metadata and controls

83 lines (46 loc) · 2.53 KB

Debug an Application Running on SAP JVM

You can debug an application running on a Cloud Foundry container that uses SAP JVM.

Note:

SAP JVM is included in SAP Java Buildpack 1. With SAP JVM, you can enable debugging on-demand without the need to set any debugging parameters, hence without having to restart the application or SAP JVM.

Context

After enabling the debugging port, you need to open an SSH tunnel that connects to this port.

Procedure

  1. To enable debugging or to check the debugging state of your JVM, run jvmmon in your Cloud Foundry container by executing:

    cf ssh <app name> -c "app/META-INF/.sap_java_buildpack/sapjvm/bin/jvmmon"
    
  2. From the jvmmon command line window, run:

    start debugging
    
  3. (Optional) To confirm that debugging is enabled and see which port is open, run:

    print debugging information
    

    The following is an example of the information displayed by jvmmon:

    State: Debugging back is waiting for debugger to connect
    Port: 8000
    Client:
    Globally accessible
    

    The default port is 8000.

  4. To exit jvmmon, run: q

  5. To open the SSH tunnel, run:

    cf ssh <app name> -N -T -L 8000:127.0.0.1:8000
    

    Your local port 8000 is connected to the debugging port 8000 of SAP JVM running in the Cloud Foundry container.

    Note:

    The connection is active until you close the SSH tunnel. When you finish debugging, close the SSH tunnel by pressing [Ctrl] + [C] .

  6. Connect a Java debugger to your application. For example, use the standard Java debugger provided by Eclipse IDE and connect to localhost:8000