Hi All,

I have a situation where I eval a script and then use invokeFunction to call a function in the script. In the case where that function calls a java method which throws a RuntimeException (in my case a null pointer) I don't see the real root cause.


      script.eval(bindings);
        try {
            Invocable invocable = (Invocable) script.getEngine();
            invocable.invokeFunction(methodName);

        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
        }

I get:
Caused by: javax.script.ScriptException: sun.org.mozilla.javascript.internal.WrappedException: Wrapped java.lang.NullPointerException (<Unknown Source>#52) in <Unknown Source> at line number 52 at com.sun.script.javascript.RhinoScriptEngine.invoke(RhinoScriptEngine.java:184) at com.sun.script.javascript.RhinoScriptEngine.invokeFunction(RhinoScriptEngine.java:142)

Which points me to the "invocable.invokeFunction(methodName);" line - not the real line where the exception occurred in Java.

Any ideas?


_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to