diff --git a/src/helma/framework/core/Application.java b/src/helma/framework/core/Application.java index 8b727d27..fac10a72 100644 --- a/src/helma/framework/core/Application.java +++ b/src/helma/framework/core/Application.java @@ -929,6 +929,14 @@ public final class Application implements IPathElement, Runnable { } return null; } + + + /** + * Return the application's classloader + */ + public ClassLoader getClassLoader () { + return typemgr.loader; + } ////////////////////////////////////////////////////////////////////////////////////////////////////////// /// The following methods mimic the IPathElement interface. This allows us diff --git a/src/helma/framework/core/RequestEvaluator.java b/src/helma/framework/core/RequestEvaluator.java index e7478dcc..17f97d0e 100644 --- a/src/helma/framework/core/RequestEvaluator.java +++ b/src/helma/framework/core/RequestEvaluator.java @@ -72,9 +72,9 @@ public final class RequestEvaluator implements Runnable { if (scriptingEngine == null) { String engineClassName = app.getProperty ( "scriptingEngine", - "helma.scripting.fesi.FesiEngine"); + "helma.scripting.fesi.PhantomEngine"); try { - Class clazz = app.typemgr.loader.loadClass (engineClassName); + Class clazz = app.getClassLoader().loadClass (engineClassName); scriptingEngine = (ScriptingEngine) clazz.newInstance (); scriptingEngine.init (app, this); } catch (Exception x) { @@ -666,6 +666,7 @@ public final class RequestEvaluator implements Runnable { if (rtx == null || !rtx.isAlive()) { // app.logEvent ("Starting Thread"); rtx = new Transactor (this, app.threadgroup, app.nmgr); + rtx.setContextClassLoader (app.getClassLoader ()); rtx.start (); } else { notifyAll (); diff --git a/src/helma/main/launcher/FilteredClassLoader.java b/src/helma/main/launcher/FilteredClassLoader.java index f93838c4..07802996 100644 --- a/src/helma/main/launcher/FilteredClassLoader.java +++ b/src/helma/main/launcher/FilteredClassLoader.java @@ -29,9 +29,7 @@ public class FilteredClassLoader extends URLClassLoader { * Mask classes that implement the scripting engine(s) contained in helma.jar */ protected Class findClass (String name) throws ClassNotFoundException { - if (name != null && (name.startsWith ("helma.scripting.fesi") || - name.startsWith ("helma.doc") || - name.startsWith ("FESI"))) + if (name != null && "helma.scripting.fesi.PhantomEngine".equals (name)) throw new ClassNotFoundException (name); return super.findClass (name); } diff --git a/src/helma/scripting/fesi/FesiEngine.java b/src/helma/scripting/fesi/FesiEngine.java index 910333fd..dc8b1587 100644 --- a/src/helma/scripting/fesi/FesiEngine.java +++ b/src/helma/scripting/fesi/FesiEngine.java @@ -25,7 +25,7 @@ import FESI.Exceptions.*; /** * This is the implementation of ScriptingEnvironment for the FESI EcmaScript interpreter. */ -public final class FesiEngine implements ScriptingEngine { +public class FesiEngine implements ScriptingEngine { // the application we're running in Application app; @@ -80,8 +80,7 @@ public final class FesiEngine implements ScriptingEngine { wrappercache = new CacheMap (200, .75f); prototypes = new Hashtable (); try { - evaluator = new Evaluator(); - evaluator.engine = this; + evaluator = new Evaluator(this); global = evaluator.getGlobalObject(); for (int i=0; i