Skip to content

This topic describes how to debug service interceptors. The debugging workflow for service interceptors, does not include a separate application to manage runtime debug settings. Instead, all debug management options are now available in ArcGIS Server Administrator Directory.

How to enable debugging

Follow these steps to enable Service Interceptor debugging.

  1. Sign in to the ArcGIS Server Administrator Directory.

  2. Browse to System -> properties and click Update.

  3. Add a port range for Service Interceptor debug connections by adding the properties JSON (example):

    { "interceptorBeginPort": "8000", "interceptorEndPort": "8010" }

  4. Choose a contiguous range of free ports that are not used by other services.

    admin port
  5. Click Update to save the change. ArcGIS Server will select a free port from the range and bind the Service Interceptor processes to that port.

  6. Set the server log level to Debug in ArcGIS Server Admin Directory: go to Site -> Logs -> Settings, set Log level to Debug, and click Save.

    service interceptor log level
  7. Check the server logs for the message that reports the port number allocated to the Service Interceptor process. It will appear in the server logs similar to the example below:

    "Interceptor debugging enabled on port: 8000"

How to debug extensions using Java IDEs

To debug a Service Interceptor from a Java IDE, first determine the debug port ArcGIS Server assigned to Service Interceptor, then attach a remote debugger from your IDE.

  1. Access the ArcGIS server logs in ArcGIS Server Admin Directory.

  2. Look for the server logs and shows the debug port. Typical messages is "Interceptor debugging enabled on port: xxxx".

    debug log service interceptors

    If you did not find this log message, it's likely that there is no available port within the port range defined in Properties to bind to the service process. See Debug tips on how to fix it.

  3. Attach the debugger in your Java IDE using the port number you found in the ArcGIS server logs.

    The following sections demonstrates how to attach the debugger in IntelliJ and Eclipse:

    Debug extensions using IntelliJ

    a. Open the Service Interceptor project in IntelliJ.

    b. Click Run > Debug > Edit Configurations.

    c. Click the Add New Configuration button (+).

    d. Choose Remote in the Add New Configuration menu.

    e. Enter the port number obtained from the previous steps in the Port text box.

    f. If your ArcGIS server and Java IDE are installed on the same machine, you can leave localhost as the Host value. If your ArcGIS server is installed on a different machine from your Java IDE, type in the host name of your server machine.

    g. Click Debug.

    debug service interceptor intellij

    Now the debugger is attached to the process. The message "Connected to the target VM, address: 'localhost:9001', transport: 'socket' "appears in the Debug tool window. You can perform service operations now to trigger the interceptor's breakpoint.

    Debug extensions using Eclipse

    a. Open the Service Interceptor project in Eclipse.

    b. Right-click your project and select Debug As….

    c. Click Remote Java Application in the list of types of applications.

    d. If this item doesn't contain any debug configurations, double-click Remote Java Application. This creates a debug configuration based on your project.

    debug service interceptor eclipse

    e. In the Port text box, type in the port number copied from ArcGIS server logs.

    f. If your ArcGIS server and Java IDE are installed on the same machine, you can leave localhost as the Host value. If your server is installed on a different machine from your Java IDE, type in the host name of your server machine.

    g. Click Debug.

    Now the debugger successfully attaches to the target process, a Debug tab becomes available in the left-side menu bar. You can then perform the relevant service operations, and the interceptor’s breakpoints will be triggered accordingly.

    debug_window_Eclipse

How to disable debugging

  1. Sign in to ArcGIS Server Admin Directory.

  2. Browse to System -> properties and click Update.

    service interceptor disable debug1
  3. Update the properties json to a empty json to disable debugging.

    service interceptor disable debug2
  4. Click Update. Debugging is now disabled in ArcGIS Server.

    service interceptor disable debug3

Debug Tips

  • Set log level to Debug.

    Before turning debugging on, open the Logs page in ArcGIS Server Admin Directory and verify that the log level in both Settings and Log Filter are set to Debug. Setting log level to Debug ensures that logs at all the levels can be captured, especially for the logs showing port number.

  • Adjust the port range.

    If you can't find the port number in server logs as the screenshot above, all the ports within the port range may be in use. In this scenario, start again with a different range of ports.

  • Remember to disable debugging.

    Remember to turn debugging off in the System -> properties, update the properties json to a empty json, and click Update after your debugging session is over.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.