How To

How do I debug server-side JavaScript code in OpenIDM 4.x?

Last updated Jan 5, 2021

The purpose of this article is to provide information on debugging server-side JavaScript® code in OpenIDM using Eclipse® IDE for Java EE developers. Debugging JavaScript code can help you troubleshoot issues with your code that cannot be resolved by adding logging to your scripts.

2 readers recommend this article

This article has been archived and is no longer maintained by ForgeRock.

Debugging JavaScript code


JavaScript debugging is only supported with Eclipse Luna; the more recent releases are not supported.

To configure JavaScript debugging via Eclipse:

  1. Download the Java EE version of Eclipse Luna from the Eclipse Downloads page.
  2. Back up and delete the following files from the /path/to/openidm/bundle directory:
    • rhino.debugger-1.0.300.v201109150503.jar
    • transport-1.0.100.v201109150330.jar
  3. Copy the following files from the Eclipse plugins directory to the /path/to/openidm/bundle directory:
    • org.eclipse.wst.jsdt.debug.rhino.debugger_1.0.400.v201402051800.jar
    • org.eclipse.wst.jsdt.debug.transport_1.0.200.v201402051800.jar
  4. Delete the contents of the /path/to/openidm/felix-cache directory.
  5. Edit the script.json file (located in the /path/to/openidm/project/conf directory) and uncomment the following line: "javascript.debug" : "transport=socket,suspend=y,address=9888,trace=true",
  6. Start Eclipse and create a new JavaScript Project.
  7. Select JavaScript > Include Path > Source within the Project Properties and add a link to the folder(s) containing the JavaScript files you want to debug via the Link External Folder... button.
  8. Start the OpenIDM instance.
  9. Attach the debugger to OpenIDM via the Run > Debug Configurations... menu item in Eclipse.

See Also

How do I add logging to JavaScript files in IDM (All versions)?

Customizing Java Log Format to use SimpleFormatter fails in IDM (All versions)

FAQ: Scripts in IDM

Related Training


Related Issue Tracker IDs


Copyright and Trademarks Copyright © 2021 ForgeRock, all rights reserved.