Enabling and Disabling the Debug ModeLocate this document in the navigation structure

You can use the SAP Management Console perspective in the SAP NetWeaver Developer Studio (Developer Studio) to enable the debug mode of the Virtual Machine of the server process on the fly, without needing to restart it.

Context

When you enable debugging, a debug port on the application server opens, to which you can connect your Developer Studio debugger and debug your applications. By default, the debug mode is inactive. If the debug mode is disabled, you have to enable it first using the Config Tool.

The SAP Java VM supports the following debug modes:

  • System debug mode, which is quite similar to the normal Sun Java VM debug. The system mode is marked as Switched on (port) .

  • Application debug mode, which offers more protection against unwanted modification of the AS Java server. The application debug mode is shown as user@host (port) .

From the SAP Management Console perspective you can only enable the application debug mode.

Procedure

  • Proceed as follows to enable the debug mode:
    1. In the navigation view, select the AS Java node and choose Process Table.
    2. In the Content View , choose the server process on which you want to open a debug port and, from the context menu, choose Start Debug Session.
    3. In the Start Debug dialog box, choose OK to enable the debug mode with the default settings.
    4. In the Logon Data dialog box, enter the SAP system administrator credentials, and choose OK .
    5. Optional: To change the default settings of the debug mode, in the Start Debug dialog box, choose Expert Mode. Choose the relevant option:
      • Suspend - to suspend all threads visible to the debugging User Interface (UI)

        Caution

        We recommend that you use the Suspend option only in combination with Code Isolation . If you use the Suspend option without Code Isolation , the debugger immediately suspends all threads, which affects the entire Java instance.

      • Code Isolation - to activate code isolation for the AS Java. Only the threads of the application you want to debug are subject to debugging. This only works for Web applications. If you do not activate Code Isolation and you end your debug session, the application server will be restarted.

      • Load Isolation - to enable load isolation, and make sure that only your request reaches the server process. This allows you to debug a heavily-loaded application. Use this option if there are two or more server processes in the system and, for example, you want to set a breakpoint in the code and trigger it using an HTTP request.

        When you set the Load Isolation , other user requests are not dispatched to the server process. The server process is load isolated, and removed from all load balancing lists. User requests cannot reach the process using any protocol (HTTP, P4, Telnet, and so on). To send an HTTP request to the server, copy the debug URL from the context menu of the server in debug state into your browser.

        Note

        If you enable the load isolation for a server process that is the only one in the instance, the server process becomes unreachable for user requests and you will not be able to deploy the application you want to debug. The color of the jstart process in the SAP MC perspective turns yellow, because the instance is considered to be non-operational.

      • Session Migration - to migrate all moveable browser sessions to other server processes. For example, activate session migration if you want to put the browser sessions on another host and be able to concentrate on the browser session created during the debug session.

        Note

        We recommend that you use the default settings.

    6. Choose the Access Points node, and in the Content View check if the debug port is open. When the port is not open, the Active state of the port in the result view has the value No.
    7. Choose the Process Table node, and in the Content View , check if the Debug state of the server process indicates that the debug mode is switched on and the debug entry is displayed.
  • Proceed as follows to disable the debug mode (to close the debug port on the server process):
    1. In the navigation view, choose Process Table.
    2. Select the relevant server process and, from the context menu, choose Stop Debug Session.
    3. In the Stop Debug Session dialog box, choose the debug entry for which you want to disable the debug mode. The debug entry consists of <debug ID>(<OS user>@<host>-server<n> ) where:
      • <debug ID> is the number automatically generated on the server side when debug mode is enabled.

      • <OS user> is the operating system user who enabled the debug mode.

      • <host> is the host of the server process.

      • server<n> is the server process.

      Example 896010077(peter@sofD60161564A-server0)
      Note

      If the debug mode you want to disable has been enabled from another location, and not from the Developer Studio you are currently using, in the Stop Debug Session dialog box, enter the debug ID number or <OS user>@<host>-server<n> .

      You can use the same procedure to stop a debug session that was started for an application server.