I have an interface ru.focusmedia.odp.server.scripts.api.Script and tried to implement it according to the example in http://docs.oracle.com/javase/6/docs/technotes/guides/scripting/programmer_guide/index.html:
new Packages.ru.focusmedia.odp.server.scripts.api.Script() {
...
};
However, this gives the following exception:
javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: TypeError: [JavaPackage ru.focusmedia.odp.server.scripts.api.Script] is not a function, it is sun.org.mozilla.javascript.internal.NativeJavaPackage. (#1) in at line number 1
new Packages.java.lang.Runnable() works. What is the problem?
UPDATE: I initially thought setting thread context class loader fixed this problem, but it reoccurred after minor changes in the script.