Open PalrajJayarajBosch opened 2 months ago
I am sorry, but the information that you have provided is not sufficient to track the problem down. For example, your error mentions WBPGraalJSScriptEngine
but this class/string is not part of the short code snippet that you have provided. Please, provide more information. It would be ideal to described exact steps that lead to the problem that you are facing. Thank you in advance.
In out Eclipse Product, we are moving away from using Nashorn Engine to GraalJS Engine. But, due to some constraints, I'm currently unable to make it work. We have a project named 'org.graalvm.js' and has added all the required jars into the libraries folder and added it to the classpath. Extracted all the ServiceRegistry file to META-INF folder.
I have refered to the help documentation at: https://www.graalvm.org/latest/reference-manual/js/ScriptEngine/
And created my own plugin named 'com.pal.script' and in MyGraalJSScriptEngine class (in same plugin), I have tried to use the load a class from Host. I tried the same class itself. But, it says
Caused by: org.graalvm.polyglot.PolyglotException: TypeError: Access to host class com.bosch.wbp.scripting.commandline.WBPGraalJSScriptEngine is not allowed or does not exist. at <js>.:program(<eval>:1) at org.graalvm.polyglot.Context.eval(Context.java:402) at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.eval(GraalJSScriptEngine.java:490) ... 36 more
The code is:
Any help would be appreciated.
Thanks, Palraj