From cb9b69943c0f9523032db61577902ea027c9f612 Mon Sep 17 00:00:00 2001 From: Dan Cunningham Date: Tue, 19 Oct 2021 07:21:06 -0700 Subject: [PATCH] [jsscripting] Tell the script context to use the classloader of the current class. (#11400) Fixes #11222 Signed-off-by: Dan Cunningham --- .../jsscripting/internal/OpenhabGraalJSScriptEngine.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles/org.openhab.automation.jsscripting/src/main/java/org/openhab/automation/jsscripting/internal/OpenhabGraalJSScriptEngine.java b/bundles/org.openhab.automation.jsscripting/src/main/java/org/openhab/automation/jsscripting/internal/OpenhabGraalJSScriptEngine.java index 7ba654eec7c..aa62c130859 100644 --- a/bundles/org.openhab.automation.jsscripting/src/main/java/org/openhab/automation/jsscripting/internal/OpenhabGraalJSScriptEngine.java +++ b/bundles/org.openhab.automation.jsscripting/src/main/java/org/openhab/automation/jsscripting/internal/OpenhabGraalJSScriptEngine.java @@ -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 options,