Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot call undefined in jvm-npm.js #24

Closed
michel-kraemer opened this issue Jun 2, 2015 · 2 comments
Closed

Cannot call undefined in jvm-npm.js #24

michel-kraemer opened this issue Jun 2, 2015 · 2 comments

Comments

@michel-kraemer
Copy link
Member

With milestone6 I get the following error:

javax.script.ScriptException: TypeError: Cannot call undefined in src/main/resources/vertx-js/util/jvm-npm.js at line number 121
        at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:56)
        at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:212)
        at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:184)
        at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:171)
        at jdk.nashorn.internal.runtime.Undefined.lookupTypeError(Undefined.java:128)
        at jdk.nashorn.internal.runtime.Undefined.lookup(Undefined.java:100)
        at jdk.nashorn.internal.runtime.linker.NashornLinker.getGuardedInvocation(NashornLinker.java:98)
        at jdk.internal.dynalink.support.CompositeTypeBasedGuardingDynamicLinker.getGuardedInvocation(CompositeTypeBasedGuardingDynamicLinker.java:176)
        at jdk.internal.dynalink.support.CompositeGuardingDynamicLinker.getGuardedInvocation(CompositeGuardingDynamicLinker.java:124)
        at jdk.internal.dynalink.support.LinkerServicesImpl.getGuardedInvocation(LinkerServicesImpl.java:144)
        at jdk.internal.dynalink.DynamicLinker.relink(DynamicLinker.java:232)
        at jdk.nashorn.internal.scripts.Script$jvm_npm._L27(src/main/resources/vertx-js/util/jvm-npm.js:121)
        at jdk.nashorn.internal.scripts.Script$jvm_npm.runScript(src/main/resources/vertx-js/util/jvm-npm.js:27)
        at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:498)
        at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:206)
        at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:378)
        at jdk.nashorn.internal.runtime.Context.evaluateSource(Context.java:885)
        at jdk.nashorn.internal.runtime.Context.load(Context.java:563)
        at jdk.nashorn.internal.objects.Global.load(Global.java:857)
        at jdk.nashorn.internal.scripts.Script$\^eval\_.runScript(<eval>:1)
        at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:498)
        at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:206)
        at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:378)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:546)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:528)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:524)
        at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:194)
        at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
        at io.vertx.test.lang.js.JSRunner.load(JSRunner.java:56)
        at io.vertx.test.lang.js.JSRunner.run(JSRunner.java:35)
        at io.vertx.test.lang.js.JSRunner.run(JSRunner.java:28)
        at io.vertx.test.lang.js.JSTestBase.runTest(JSTestBase.java:15)
        at io.vertx.test.lang.js.TimeoutTest.testClearInterval(TimeoutTest.java:31)

The problem points to the following line

var synchronizedDoRequire = Java.synchronized(doRequire, verticleFactoryClass);

In milestone5 everything worked correctly.

This also happens if I just run mvn test so it seems it's not my code causing this issue. I use JDK 1.8.0_31 by the way. Maybe there's some Nashorn feature that has been added in 1.8.0_40?

Thanks,
Michel

@vietj
Copy link
Contributor

vietj commented Jun 2, 2015

yes please try the latest JDK 1.8.0_45, that should fix the problem.

@michel-kraemer
Copy link
Member Author

OK. Done. I can confirm it's working with 1.8.0_45. Thanks a lot!

I'm closing this one, but I wonder if it might be worthwhile supporting older versions as well or at least issue a warning or a sensible error message.

Cheers,
Michel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants