Debugging SOEs


Summary
This topic describes how to debug Java extensions. The debugging workflow for server object extensions does not include a separate application to manage runtime debug settings. Instead, all debug management options are now available in ArcGIS Server Manager.

How to enable debugging
 
  1. Log into ArcGIS Server Manager.
  2. Ensure that the SOE you wish to debug into is deployed to ArcGIS Server.
  3. Publish a map service and enable the above SOE on it.
  1. Navigate to Site -> Extensions. Click the “Debug Settings” button.
  1. Click “Enable debugging of extensions” to enable debugging.
  1. Check the “Suspend service startup” checkbox and provide a time window in milliseconds if you wish to debug into the lifecycle methods of your extension. Examples of lifecycle methods are init() and shutdown(). These methods are invoked by the parent map service during the startup and shutdown phases. When the map service starts, Server freezes initialization of the map service for the duration specified by this time window, thus allowing you to set a breaking point in init() or other lifecycle methods and connect the IDE debug session to the ArcGIS Server process hosting the SOE.
  2. Specify a port range. ArcGIS Server will select a port from this range, bind your map service and SOE’s process to the next available port from this range, and listen to the incoming connection request on this port.
  3. Click “Save”. Debugging is now enabled on ArcGIS Server.
  4. Restart the map service that your SOE is enabled on, for above changes to take effect.
How to debug into Java SOEs using Eclipse IDE
 
  1. Determine the port number that ArcGIS Server is listening on, as follows:
    1. Access the server logs in ArcGIS Server Manager.
    2. Set the Log Filter to “Verbose” level.
    3. Set the Age to “Last 15 Minutes”.
    4. Set the Source to “All”.
    5. Set the Machine to “All Machines”.
    6. Click “Update”.
    7. Pick up the port number from the log entry that mentions the name of the map service your SOE is enabled on and the name of your SOE. In the example below, the port number selected by ArcGIS Server is 9000:
  1. Switch to Eclipse.
  2. Right click your SOE class.
  3. Select “Debug As…”. Click Remote Java Application from list of types of applications.
  4. Select your SOE. If your SOE does not show up as an item in the “Remote Java Application” list, create a new launch configuration within this type.
  1. In the Port text box, type in the port number copied from ArcGIS Server Manager.
  2. Click Debug.
  3. Set breakpoints in your SOE code, if not already set.
  4. Consume the SOE via its client application. The SOE execution on ArcGIS Server will stop at the breakpoint you set in Eclipse.
How to disable debugging
 
  1. Log into ArcGIS Server Manager.
  2. Navigate to Site -> Extensions. Click the “Debug Settings” button.
  1. Uncheck the “Enable debugging of extensions” check-box to disable debugging.
  1. Click “Save”. Debugging is now disabled on ArcGIS Server.
  2. Restart the map service that your SOE is enabled on, for above changes to take effect.
Some tips
 






Development licensingDeployment licensing
ServerServer