teamvk / jsengine Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v2.0
License: GNU General Public License v2.0
I asked this in the BigDoorsOpener discussion forum
... will BDO work with other Nashorn providers, say JSEngine?
The response (with a few formatting and spelling corrections) was
No, it won't work with JSEngine sadly. That because it uses an individual way, which is not independent to its implementor.
I am already using the most independent way with the ServiceManager. The JSEngine Plugin requires that I know that the plugin exists.
My NashornJs engine does not requires to know its name or if it exists. It registers a service which everyone can use at runtime without calling the plugin or anything.
BDO will work with every Nashorn engine provider which registers a ScriptEngineManager as a bukkit service. At least as long as the plugin implements it properly and registers it as early as possible.
The JSEngine even requires that I add it as a compileOnly dependency. Which is not required when using NashornJS by me. It's doing exactly what I am trying to avoid at all costs.
Perhaps JSEngine should address these issues, so that it can be used in a more general way.
If this is a BigDoorsOpener issue please advise, and I will post there.
Versions:
>version
[07:14:19] [Server thread/INFO]: This server is running CraftBukkit version 3241-Spigot-6c1c1b2-1492826 (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT)
[07:14:19] [Server thread/INFO]: You are running the latest version
>version JSEngine
[07:19:08] [Server thread/INFO]: JSEngine version 3.0.4
[07:19:08] [Server thread/INFO]: Author: vk2gpz
>version BigDoorsOpener
[07:14:53] [Server thread/INFO]: BigDoorsOpener version 2.4.4
[07:14:53] [Server thread/INFO]: Open and close doors automatically on certain conditions
[07:14:53] [Server thread/INFO]: Website: www.spigotmc.org/resources/80805/
[07:14:53] [Server thread/INFO]: Author: Hadde
Problem
JSEngine failure on server start-up, with Java 17. (Yes, it's brand new; posting for tracking purposes.)
Expected behavior
Clean start-up
Stacktrace
[07:09:38] [Server thread/INFO]: [BigDoorsOpener] Hooked into Big Doors successfully.
[07:09:38] [Server thread/INFO]: [BigDoorsOpener] World Guard found. Trying to get a hook.
[07:09:38] [Server thread/INFO]: [BigDoorsOpener] Hooked into world guard successfully.
[07:09:38] [Server thread/INFO]: [BigDoorsOpener] Placeholder API found. Enabling placeholder usage.
[07:09:38] [Server thread/INFO]: [BigDoorsOpener] MythicMobs not found. MythicMobs conditions are disabled.
[07:09:38] [Server thread/INFO]: [BigDoorsOpener] Config is up to date.
[07:09:38] [Server thread/INFO]: [BigDoorsOpener] Config loaded!
[07:09:38] [Server thread/INFO]: [BigDoorsOpener] Java 15 or newer detected. Searching for external Engine.
[07:09:38] [Server thread/ERROR]: [BigDoorsOpener] Plugin post start failed.
java.lang.ExceptionInInitializerError: null
at org.openjdk.nashorn.internal.runtime.Context.compile(Context.java:1509) ~[?:?]
at org.openjdk.nashorn.internal.runtime.Context.compileScript(Context.java:1449) ~[?:?]
at org.openjdk.nashorn.internal.runtime.Context.compileScript(Context.java:759) ~[?:?]
at org.openjdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(NashornScriptEngine.java:528) ~[?:?]
at org.openjdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(NashornScriptEngine.java:517) ~[?:?]
at org.openjdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:395) ~[?:?]
at org.openjdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:151) ~[?:?]
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:262) ~[java.scripting:?]
at de.eldoria.bigdoorsopener.util.CachingJSEngine.<init>(CachingJSEngine.java:55) ~[?:?]
at de.eldoria.bigdoorsopener.core.BigDoorsOpener.onPostStart(BigDoorsOpener.java:147) ~[?:?]
at de.eldoria.bigdoorsopener.eldoutilities.plugin.EldoPlugin$1.run(EldoPlugin.java:220) ~[?:?]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:82) ~[spigot-1.17.1-3241.jar:3241-Spigot-6c1c1b2-1492826]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:415) ~[spigot-1.17.1-3241.jar:3241-Spigot-6c1c1b2-1492826]
at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1269) ~[spigot-1.17.1-3241.jar:3241-Spigot-6c1c1b2-1492826]
at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:438) ~[spigot-1.17.1-3241.jar:3241-Spigot-6c1c1b2-1492826]
at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1217) ~[spigot-1.17.1-3241.jar:3241-Spigot-6c1c1b2-1492826]
at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1050) ~[spigot-1.17.1-3241.jar:3241-Spigot-6c1c1b2-1492826]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:305) ~[spigot-1.17.1-3241.jar:3241-Spigot-6c1c1b2-1492826]
at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: no such method: sun.misc.Unsafe.defineAnonymousClass(Class,byte[],Object[])Class/invokeVirtual
at org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.lambda$getDefineAnonymousClass$0(Context.java:335) ~[?:?]
at java.security.AccessController.doPrivileged(AccessController.java:318) ~[?:?]
at org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.getDefineAnonymousClass(Context.java:327) ~[?:?]
at org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.<clinit>(Context.java:317) ~[?:?]
... 19 more
Caused by: java.lang.NoSuchMethodException: no such method: sun.misc.Unsafe.defineAnonymousClass(Class,byte[],Object[])Class/invokeVirtual
at java.lang.invoke.MemberName.makeAccessException(MemberName.java:976) ~[?:?]
at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1117) ~[?:?]
at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:3649) ~[?:?]
at java.lang.invoke.MethodHandles$Lookup.findVirtual(MethodHandles.java:2680) ~[?:?]
at org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.lambda$getDefineAnonymousClass$0(Context.java:329) ~[?:?]
at java.security.AccessController.doPrivileged(AccessController.java:318) ~[?:?]
at org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.getDefineAnonymousClass(Context.java:327) ~[?:?]
at org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.<clinit>(Context.java:317) ~[?:?]
... 19 more
Caused by: java.lang.NoSuchMethodError: 'java.lang.Class sun.misc.Unsafe.defineAnonymousClass(java.lang.Class, byte[], java.lang.Object[])'
at java.lang.invoke.MethodHandleNatives.resolve(Native Method) ~[?:?]
at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:1085) ~[?:?]
at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1114) ~[?:?]
at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:3649) ~[?:?]
at java.lang.invoke.MethodHandles$Lookup.findVirtual(MethodHandles.java:2680) ~[?:?]
at org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.lambda$getDefineAnonymousClass$0(Context.java:329) ~[?:?]
at java.security.AccessController.doPrivileged(AccessController.java:318) ~[?:?]
at org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.getDefineAnonymousClass(Context.java:327) ~[?:?]
at org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.<clinit>(Context.java:317) ~[?:?]
... 19 more
[07:09:38] [Server thread/ERROR]: [BigDoorsOpener] Initializing failsave mode.
Config
script_engine_names:
- js
- JS
- javascript
- JavaScript
- ecmascript
- ECMAScript
- nashorn
- Nashorn
# if this option is true, even if ScriptEngineManager already has a factory
# for JavaScript, this plugin will try to replace it with openjdk nashorn.
ForceNashorn: true
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.