From 0c9ecfd10da8e8a470891c189e4b93093dab7454 Mon Sep 17 00:00:00 2001 From: hns Date: Mon, 1 Dec 2003 13:28:20 +0000 Subject: [PATCH] Set application classloader on the Rhino context to our app classloader. --- src/helma/scripting/rhino/RhinoCore.java | 1 + src/helma/scripting/rhino/RhinoEngine.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/helma/scripting/rhino/RhinoCore.java b/src/helma/scripting/rhino/RhinoCore.java index 17647244..8fefb949 100644 --- a/src/helma/scripting/rhino/RhinoCore.java +++ b/src/helma/scripting/rhino/RhinoCore.java @@ -69,6 +69,7 @@ public final class RhinoCore { Context context = Context.enter(); context.setCompileFunctionsWithDynamicScope(true); + context.setApplicationClassLoader(app.getClassLoader()); wrapper = new WrapMaker(); wrapper.setJavaPrimitiveWrap(false); context.setWrapFactory(wrapper); diff --git a/src/helma/scripting/rhino/RhinoEngine.java b/src/helma/scripting/rhino/RhinoEngine.java index 05686a21..c4630111 100644 --- a/src/helma/scripting/rhino/RhinoEngine.java +++ b/src/helma/scripting/rhino/RhinoEngine.java @@ -79,6 +79,7 @@ public class RhinoEngine implements ScriptingEngine { core = getRhinoCore(app); context = Context.enter(); context.setCompileFunctionsWithDynamicScope(true); + context.setApplicationClassLoader(app.getClassLoader()); try { global = new GlobalObject(core, app); // context.newObject(core.global); @@ -144,6 +145,7 @@ public class RhinoEngine implements ScriptingEngine { public void updatePrototypes() { context = Context.enter(); context.setCompileFunctionsWithDynamicScope(true); + context.setApplicationClassLoader(app.getClassLoader()); context.setWrapFactory(core.wrapper); boolean trace = "true".equals(app.getProperty("rhino.trace"));