]> git.basschouten.com Git - openhab-addons.git/commitdiff
[jsscripting] Tell the script context to use the classloader of the current class...
authorDan Cunningham <dan@digitaldan.com>
Tue, 19 Oct 2021 14:21:06 +0000 (07:21 -0700)
committerGitHub <noreply@github.com>
Tue, 19 Oct 2021 14:21:06 +0000 (16:21 +0200)
Fixes #11222

Signed-off-by: Dan Cunningham <dan@digitaldan.com>
bundles/org.openhab.automation.jsscripting/src/main/java/org/openhab/automation/jsscripting/internal/OpenhabGraalJSScriptEngine.java

index 7ba654eec7cfbab43945446bea73cb14973f3394..aa62c1308592e4107c35079c6272c3ad19e59517 100644 (file)
@@ -70,6 +70,7 @@ public class OpenhabGraalJSScriptEngine extends InvocationInterceptingScriptEngi
                         .option("js.commonjs-require-cwd", MODULE_DIR).option("js.nashorn-compat", "true") // to ease
                                                                                                            // migration
                         .option("js.commonjs-require", "true") // enable CommonJS module support
+                        .hostClassLoader(getClass().getClassLoader())
                         .fileSystem(new DelegatingFileSystem(FileSystems.getDefault().provider()) {
                             @Override
                             public SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options,