> ClassLoader webappLoader =
> Thread.currentThread().getContextClassLoader();
> Class webappClass = webappLoader.loadClass("com.mycompany.MyClass");
> This works because the container (Tomcat in this case) always sets the
thread context class loader to the one
> for the webapp being executed on the current request thread -- therefore,
the classes in /WEB-INF/classes and
> /WEB-INF/lib are visible via this class loader, even though the class
containing the above code is loaded
> from somewhere else.
Craig,
I still get a ClassNotFoundException. I've implemented a Realm that extends
RealmBase. My code that references the webapp class is in getPassword().
I'm assuming that this is called from a request thread?
What's interesting is that loadClass() doesn't throw the exception, but then
I try to call webappClass.newInstance(), a ClassNotFoundException is thrown?
Any ideas? Thanks.
-Mark
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>