Debugging an extension


How to enable debugging
  1. Log into ArcGIS Server Manager.
  2. Ensure that the extension you wish to debug into is deployed to ArcGIS Server.
  3. Publish a map or image service and enable the extension you wish to debug.
  4. Navigate to Site > Extensions. Click the Debug Settings button.
  5. Click Enable debugging of extensions to enable debugging.
  6. 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 extension.
  7. Specify a port range. ArcGIS Server will select a port from this range, bind your map service and extension’s process to the next available port from this range, and listen to the incoming connection request on this port.
  8. Click Save. Debugging is now enabled on ArcGIS Server.
  9. Restart the map service that your extension is enabled on, for above changes to take effect.
How to debug into Java extensions 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 extension is enabled on and the name of your extension. For example, you may see the port number selected by ArcGIS Server is 9000.
  2. Switch to Eclipse.
  3. Right click your extension class.
  4. Select Debug As… and click Remote Java Application from list of types of applications.
  5. Select your extension. If your extension does not show up as an item in the Remote Java Application list, create a new launch configuration within this type.
  6. In the Port text box, type in the port number copied from ArcGIS Server Manager.
  7. Click Debug.
  8. Set breakpoints in your extension code, if not already set.
  9. Consume the extension via its client application. The extension 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.
  3. Uncheck the Enable debugging of extensions check-box to disable debugging.
  4. Click Save. Debugging is now disabled on ArcGIS Server.
  5. Restart the map service that your extension is enabled on, for above changes to take effect.
Tips