Hi, I am trying to get Fortress to use a custom classloader (source attached). The only difference from URLClassLoader is that I don't want to check the parent classloader first to load the class.
This works fine with my test classes/packages. However, when I use it with
Fortress, o.a.e.f.AbstractContainer#getComponentHandler gets a
NoSuchMethodException whenever it tries to get the constructor for
ThreadSafeComponentHandler. I tried getting handlerKlass.constructors()[0]
explicitly, and in the debugger I see that it is the right constructor, with
the 6 correct parameter types. But when the next line calls
newInstance(Object[] {....}), it gets a invalid parameter exception.
If I replace KeelURLClassLoader with URLClassLoader and change nothing else,
everything works fine. If I use KeelURLClassLoader, but force it to get the
class from the parent classloader, then everything works fine. The problem
happens whenever KeelURLClassLoder#findClass() is called!
I have been staring at this for two days and am at wit's end.....any help
would be much appreciated.
Thanks,
Shash
PS: If it makes a difference, here's how I am setting the loader. I am
using the identical (system) classpath for both the parent and custom
class-loaders for the test.
ClassLoader loader = new KeelURLClassLoader(
new
URLClassLoaderPath(System.getProperty("java.class.path").getURLArray(),
ClassLoader.getSystemClassLoader());
contextBuilder.setContextClassLoader(loader);
containerManager = new DefaultContainerManager(
contextBuilder.getContext(), log);
containerManager.initialize();
KeelURLClassLoader.java
Description: Binary data
URLClassLoaderPath.java
Description: Binary data
-- To unsubscribe, e-mail: <mailto:avalon-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:avalon-dev-help@;jakarta.apache.org>
