This topic describes how to debug Java extensions with a dedicated instance in ArcGIS Enterprise on Kubernetes by attaching a remote debugger from IntelliJ IDEA to the ArcSOC process running inside a MapServer or ImageServer pod.


Prerequisites

RequirementNotes
IntelliJ IDEAMust support Remote JVM Debug
kubectlConfigure access to the Kubernetes cluster
Visual Studio Code with Kubernetes extensionsUsed to inspect pods and forward ports
Access to ArcGIS Enterprise on KubernetesRequires administrator privileges
SOE/SOI deployed to ArcGIS Enterprise on KubernetesExtension must be enabled on a Map/Image service

How to enable debugging

1. Configure service instance settings

Using a single instance helps ensure that the debugger attaches to the correct ArcSOC process. This simplifies the process of identifying the correct ArcSOC process during debugging.

Please follow the steps below:

  1. Navigate to the ArcGIS Server Admin REST endpoint: https://<domain>/<serverWebAdaptor>/admin/services/SampleWorldCities.MapServer. For this guide, we will use SampleWorldCities.MapServer as a example, please find your debug map or image service.

  2. Click Edit Service.

  3. Set the following properties:

    Use dark colors for code blocksCopy
    1
    2
    "maxInstancesPerNode": 1,
    "minInstancesPerNode": 1
  4. Click Save Edit.


2. Upload and Enable the SOE extension

  1. Sign in to ArcGIS Enterprise Manager: https://<domain>/<serverWebAdaptor>/manager.

  2. Ensure that the extension to debug into is deployed to ArcGIS Enterprise Manager.

  3. Open the ArcGIS Enterprise portal.

  4. Ensure that the extension is enabled with the published dedicated map service or image service, in here we use SampleWorldCities map service.


3. Enable debug mode

  1. Sign in ArcGIS Enterprise Manager: https://<domain>/<serverWebAdaptor>/manager.

  2. Go to Services and find the SampleWorldCities map service.

  3. Go to the Advanced tab.

  4. Enable: Enable debug mode registersoeink8s enablddebug

  5. Configure the following optional settings:

    SettingExample
    Suspend service at startupEnabled
    Time window60 seconds
    Debug port range8014–8020
  6. For above optional settings, please specify a port range.

  7. Click Save.

After this setting is saved, when you start a service with an SOE or SOI enabled, ArcGIS Server will select one of the available ports from this range, bind your service and extension’s process to this port, and listen to the incoming connection request on this port. If you start another service with an extension enabled afterward, ArcGIS Server will bind the new service and extension’s process to the next available port within the port range. If all the ports within the port range have been bound to the existing processes when a new service is being started with an SOE or SOI enabled, the service will still start successfully with the extension enabled but will not bind any port to its process.


4. Verify debug logging

Once you enabled 'debug' , then you must find the port number that ArcGIS Server is listening on, please follow below steps:

  1. Access to the server logs in ArcGIS Enterprise Manager.

  2. Enable Info level at ArcGIS Enterprise Manager > Logs> Settings> Set default log level and click Save.

    k8s logs
  3. Find the port number that ArcGIS Server is listening on that mentioned as below log information and the port number selected by ArcGIS Server is 8016, and expected log message:SOE debugging is enabled on service 'xxx.MapServer'.The ArcSOC will listen for connections on port 8016.

    extensiondebugmessage

5. Identify the correct Kubernetes pod

Using Visual Studio Code

  1. Open Visual Studio Code and enable the Kubernetes extension.

  2. Add the existing cluster using the 'admin.config' file.

  3. Wait for the cluster connection to complete.

  4. Change the active Namespace to 'arcgis'.

  5. Navigate to WorkloadsDeployments.

  6. Find the deployment matching "deploymentId": "kb3ha7fa1a3xmrhr4ocyp" (retrieved it from the service properties in ArcGIS Server Admin). deployid

  7. Confirm the map/image service name is match on the deployment.

  8. Forward Ports: Right-click the deployment and select Forward Port.

  9. Enter the following port mappings: 8443:8443 8000:8000 <debug_port>:<debug:port>

    Based on above port number from ArcGIS Server log:

    Use dark colors for code blocksCopy
    1
    8443:8443 8000:8000 8016:8016

6. Attach the IntelliJ remote debugger

  1. Open the SOE/SOI project in IntelliJ IDEA.

  2. Navigate to RunDebugEdit Configurations.

  3. Click:

    Use dark colors for code blocksCopy
    1
      + → Remote JVM Debug
  4. Configure as below:

    FieldValue
    Nametest
    Debugger ModeAttach to Remote JVM
    TransportSocket
    Hostlocalhost
    Port8016
    Module Classpathdownloadrestsoe.soe
    debugIntelliJSettings
  5. Click Apply.

  6. Click Debug.

Expected debugger output:

Use dark colors for code blocksCopy
1
Connected to the target VM, address: 'localhost:8016', transport: 'socket'.
debugIntelliJ

The debugger is now attached to the ArcSOC JVM process. Trigger service operations to hit breakpoints in the SOE/SOI code.


7. Disable debugging after testing

  1. Sign in ArcGIS Enterprise Manager.
  2. Navigate to: ServicesMap/Image ServiceAdvanced.
  3. Disable:Enable debug mode.
  4. Click Save.
  5. Restart the service.

Disabling debug mode restores normal service behavior and improves security.


Debugging tips

1. Disable debugging when finished

Always disable debug mode after completing debugging sessions to restore normal performance and reduce security exposure.


2. Use a single service instance

Recommended settings:

Use dark colors for code blocksCopy
1
2
"maxInstancesPerNode": 1,
"minInstancesPerNode": 1

This simplifies identifying the correct ArcSOC process during debugging.


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