Error: Exception uncaught JavaScript runtime exception

  • 7004607
  • 06-Oct-2009
  • 26-Apr-2012

Environment

Novell Sentinel 6.1
Novell Sentinel 6.1 Hotfix 1
Novell Sentinel 6.1 SP1
Novell Sentinel 6.1 SP1 Hotfix 1

Situation

Action Plugins are run in a protected execution environment that is intended to help protect the system from accidental corruption of the data objects used by Sentinel. For some Action Plugins to execute, they may need access to the Sentinel data objects. To allow this, the Sentinel Execution Permissions need to be modified.  The following is an example of the error thrown when this is not set properly.


Wed May 13 15:30:39 MDT
2009|SEVERE|Thread-19303674|esecurity.ccs.comp.script.executor.JavaScriptExecutor.execute
; Exception uncaught JavaScript runtime exception: TypeError:
getInstance is not a function, it is org.mozilla.javascript.NativeJavaPackage.
(/opt/novell/sentinel6/data/das_query.cache/javascript
_action_plugins/CustomEmail0_6_1r1_B35C8640-1740-102C-AB87-001C2303F87F_23303690/customer.js#51);
org.mozilla.javascript.EvaluatorException;
Wed May 13 15:30:39 MDT
2009|SEVERE|Thread-19303674|esecurity.ccs.comp.script.executor.JavaScriptExecutor.execute
org.mozilla.javascript.EvaluatorException: uncaught JavaScript runtime
exception: TypeError: getInstance is not a function, it is
org.mozilla.javascript.NativeJavaPackage. (/opt/novell/sentinel6/
data/das_query.cache/javascript_action_plugins/CustomEmail0_6_1r1_B35C8640-1740-102C-AB87-001C2303F87F_23303690/customer.js#51)
at
org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:109)
at
org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.java:96)
at
org.mozilla.javascript.tools.ToolErrorReporter.reportException(ToolErrorReporter.java:164)
at
org.mozilla.javascript.tools.shell.Main.evaluateScript(Main.java:526)
at
org.mozilla.javascript.tools.shell.Main.processFileSecure(Main.java:446)
at
org.mozilla.javascript.tools.shell.Main.processFile(Main.java:412)
at
org.mozilla.javascript.tools.shell.Global.load(Global.java:231)
at
esecurity.ccs.comp.script.executor.ScriptFunctions.load(ScriptFunctions.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
at
org.mozilla.javascript.FunctionObject.call(FunctionObject.java:474)
at
org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
at
org.mozilla.javascript.gen.c3821._c0(/opt/novell/sentinel6/data/das_query.cache/javascript_action_plugins/CustomEmail0_6_1r1_B35C8640-1740-102C-AB87-001C2303F87F_23303690/main.js:349)
at
org.mozilla.javascript.gen.c3821.call(/opt/novell/sentinel6/data/das_query.cache/javascript_action_plugins/CustomEmail0_6_1r1_B35C8640-1740-102C-AB87-001C2303F87F_23303690/main.js)
at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
at
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
at
org.mozilla.javascript.gen.c3821.call(/opt/novell/sentinel6/data/das_query.cache/javascript_action_plugins/CustomEmail0_6_1r1_B35C8640-1740-102C-AB87-001C2303F87F_23303690/main.js)
at
org.mozilla.javascript.gen.c3821.exec(/opt/novell/sentinel6/data/das_query.cache/javascript_action_plugins/CustomEmail0_6_1r1_B35C8640-1740-102C-AB87-001C2303F87F_23303690/main.js)
at
org.mozilla.javascript.Context.evaluateString(Context.java:1196)
at
esecurity.ccs.comp.script.executor.JavaScriptExecutor.execute(JavaScriptExecutor.java:80)
at
esecurity.ccs.comp.correlation.action.CorrelationScriptExecutor$1.run(CorrelationScriptExecutor.java:174)
at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)
at java.lang.Thread.run(Thread.java:595)

Resolution

Fix #1 - Update to Sentinel 6.1 SP1 Hotfix 2 or later.

Fix #2 - Update the Sentinel Execution Permissions.

The property security.execution.script.context.restricted in the $ESEC_HOME/config/execution.properties file is set to false, to enable full execution permissions for Action plugins.

Perform the following steps to modify the Sentinel Execution Permissions:

1.  Log in to the Sentinel server machine as a user with privileges to edit the files in the $ESEC_HOME directory.
2.  Locate the $ESEC_HOME/config/execution.properties file and open it in a file editor.
3.  Append/Modify the file to set the esecurity.execution.script.context.restricted property to false.

esecurity.execution.script.context.restricted = false

4.  Save and close the file.
5.  Restart Sentinel:

Windows*: Stop and then Start the Sentinel service in the Services Control Panel applet.

Linux: Log in as a root user and execute the following commands:
/etc/init.d/sentinel stop
/etc/init.d/sentinel start

Note: For Sentinel versions 6. 1 GMC through 6.1 SP1 HF1, these steps are mandatory for proper execution of Action Plugins, as the property esecurity.execution.script.context.restricted is not set by default.  In Sentinel 6.1 SP1 Hotfix 2 or later this setting is already configured.