Hi,
I want to weave interceptors which loaded by a user-defined class loader (like NetworkClassLoader), but I got a javassist.NotFoundException. My code is as follows
ClassLoader loader = new ... // my class loader Thread.currentThread().setContextClassLoader(loader); Class clazz = Class.forName("aspect.GreetingInterceptor", false, loader); AdviceBinding binding = new AdviceBinding(); binding.setPointcutExpression("execution(* *.Test->*(..))"); binding.addInterceptor(clazz); AspectManager.instance().addBinding(binding); Test t = new Test(); t.print();
Exception generating JoinPoint_print4216308509294254048_1: aspect.GreetingInterceptor java.lang.RuntimeException: Error generating joinpoint class for joinpoint Method[method=public void Test.print()] at org.jboss.aop.instrument.JoinPointGenerator.doGenerateJoinPointClass(JoinPointGenerator.java:321) ... Caused by: javassist.NotFoundException: aspect.GreetingInterceptor at javassist.ClassPool.get(ClassPool.java:436) at org.jboss.aop.util.ReflectToJavassist.classToJavassist(ReflectToJavassist.java:49) at org.jboss.aop.instrument.JoinPointGenerator$AdviceSetup.<init>(JoinPointGenerator.java:1390) ...
Oops, sorry. This question should be posted in a users forum. Please ignore it.