Hello-
I'm hoping to be able to drive the closure compiler from JavaScript by
running Rhino.
Wit the latest Closure compiler.jar (Nov 6, 2010) and Rhino 1.7R2
js.jar on my classpath, I get a wrapped NullPointerException when
trying to call compile (running the script here:
https://gist.github.com/665609
with org.mozilla.javascript.tools.shell.Main*). The trace is below.
Is this due to conflicts between Rhino 1.7R2 and the 1.5R3, with
"heavy modifications" included with Closure? I see the jarjar'd
version and see that the modified version is renamespaced, so I was
guessing I wouldn't run in to conflicts.
Thanks for any tips,
Tim
* I also notice that if I try to run the script with
com.google.javascript.jscomp.mozilla.rhino.tools.shell.Main, I get all
sorts of NoClassDefFoundError.
calling compiler.compile(externs, inputs, options):
org.mozilla.javascript.WrappedException: Wrapped
java.lang.NullPointerException
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:
1773)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:183)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:
247)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:
86)
at org.mozilla.javascript.gen.c1._c0(Unknown Source)
at org.mozilla.javascript.gen.c1.call(Unknown Source)
at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:
398)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:
3065)
at org.mozilla.javascript.gen.c1.call(Unknown Source)
at org.mozilla.javascript.gen.c1.exec(Unknown Source)
at org.mozilla.javascript.tools.shell.Main.evaluateScript(Main.java:
564)
at
org.mozilla.javascript.tools.shell.Main.processFileSecure(Main.java:
486)
at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:452)
at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:
443)
at org.mozilla.javascript.tools.shell.Main.processFiles(Main.java:
196)
at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:117)
at org.mozilla.javascript.Context.call(Context.java:515)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:
507)
at org.mozilla.javascript.tools.shell.Main.exec(Main.java:179)
at org.mozilla.javascript.tools.shell.Main.main(Main.java:157)
Caused by: java.lang.NullPointerException
at com.google.javascript.jscomp.Compiler.newTracer(Unknown Source)
at com.google.javascript.jscomp.Compiler.compile(Unknown Source)
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:597)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
... 18 more