[jboss-user] [JBoss AOP] - Using a custom ClassLoader with JBoss AOP in Standalone Mode

ttarhan do-not-reply at jboss.com
Fri Dec 15 17:06:41 EST 2006


Hello,

I am having trouble making JBoss AOP (standalone) use my custom class loader.  To keep the example simple, let's say I have a ClassLoader called CustomClassLoader which loads classes from a source other than the class path.

Now, assume we have these two classes

class A {
    B someVariable;
}

class B {
    A someVariable;
}

When my CustomClassLoader loads Class A and passes the class's byte[] to transform() OR if I use -javaagent and my CustomClassLoader simply calls defineClass, the AOP library tries to resolve the reference to Class B from within Class A.  The problem is that it doesn't use my CustomClassLoader to do this -- it searches the classpath all on its own.  I've tried changing the threadContextClassLoader, I've tried registering my classloader with the aspect manager.  No matter what I do, the AOP framework uses its own class loader.

Any help on forcing the aspecting framework to use my own classloader to resolve references would be greatly appreciated.

I am using JBoss AOP 1.5.2.GA with JDK 1.5.

Thanks,
Tolga Tarhan

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994355#3994355

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994355



More information about the jboss-user mailing list