I'm trying to Java.extend(SomeClass, {}); with the javascript examples, and running into a TypeError TypeError: Could not determine a class loader with access to the JS engine and class com.thing.SomeClass. I've tried both executing the node binary directly with the javascript file, as well as starting in Java and using Context context = Context.newBuilder().allowHostAccess(true).engine(Engine.newBuilder().build()).build(); and context.eval("js", "...");. It seems that the underlying polyglot engine is still made during the bootpath classloader creation and so is unable to extend application classloader types. I made a question over on stack overflow as well https://stackoverflow.com/questions/48728080/graalvm-nashorn-cannot-extend-classes and it looks like I might be one of the first to hit this :) I was hoping someone in this project might have more guidance, or a way to get the javascript executing in the application classloader.
I'm trying to
Java.extend(SomeClass, {});
with the javascript examples, and running into a TypeErrorTypeError: Could not determine a class loader with access to the JS engine and class com.thing.SomeClass
. I've tried both executing thenode
binary directly with the javascript file, as well as starting in Java and usingContext context = Context.newBuilder().allowHostAccess(true).engine(Engine.newBuilder().build()).build();
andcontext.eval("js", "...");
. It seems that the underlying polyglot engine is still made during the bootpath classloader creation and so is unable to extend application classloader types. I made a question over on stack overflow as well https://stackoverflow.com/questions/48728080/graalvm-nashorn-cannot-extend-classes and it looks like I might be one of the first to hit this :) I was hoping someone in this project might have more guidance, or a way to get the javascript executing in the application classloader.