Skip to content
This repository has been archived by the owner on Apr 23, 2019. It is now read-only.

When node is not installed, rhino engine throws NoSuchMethodError #82

Open
wsargent opened this issue Jul 12, 2017 · 2 comments
Open

When node is not installed, rhino engine throws NoSuchMethodError #82

wsargent opened this issue Jul 12, 2017 · 2 comments

Comments

@wsargent
Copy link
Member

This is an example of sbt/sbt-js-engine#56, where an old version of Rhino seems to be causing errors:

[info] LESS compiling on 1 source(s)
[error] java.lang.NoSuchMethodError: org.mozilla.javascript.ScriptRuntime.setObjectProp(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;Lorg/mozilla/javascript/Context;Lorg/mozilla/javascript/Scriptable;)Ljava/lang/Object;
[error] 	at io.apigee.trireme.node10.main.trireme._c_anonymous_1(trireme.js:37)
[error] 	at io.apigee.trireme.node10.main.trireme.call(trireme.js)
[error] 	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
[error] 	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3102)
[error] 	at io.apigee.trireme.node10.main.trireme.call(trireme.js)
[error] 	at io.apigee.trireme.core.internal.ScriptRunner.runScript(ScriptRunner.java:762)
[error] 	at io.apigee.trireme.core.internal.ScriptRunner$4.run(ScriptRunner.java:702)
[error] 	at org.mozilla.javascript.Context.call(Context.java:488)
[error] 	at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:504)
[error] 	at io.apigee.trireme.core.internal.ScriptRunner.call(ScriptRunner.java:697)
[error] 	at io.apigee.trireme.core.ScriptFuture.run(ScriptFuture.java:183)
[error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error] 	at java.lang.Thread.run(Thread.java:748)

The note in https://github.com/ksoichiro/gradle-web-resource-plugin/blob/master/build.gradle#L51 seems to explain why:

// java.lang.NoSuchMethodError: org.mozilla.javascript.ScriptRuntime.setObjectProp
--
  | // Gradle distribution has an older Rhino (1.7R3) and causing conflict.
  | // In 1.7R3, ScriptRuntime does not have setObjectProp() method, which causes the above error.

So the solution should be to update Rhino. I'm not sure how/why an outdated Rhino would be loaded, but that's another question.

The workaround is to install an up-to-date node.js from https://nodejs.org/en/download/package-manager/

@Freshwood
Copy link

@wsargent
I am just wondering why we had this problem with play 2.6.1 version.
With the M- releases we had no problems with this?
Are there any changes in the play framework related to this problem?
Best wishes,
Btw: Thank you for your excellent work!!!
Freshwood

@wsargent
Copy link
Member Author

The updated sbt-web plugins happened fairly late in the process. It's probably connected to playframework/playframework#7045

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants