[jboss-user] [JBoss AOP] - Re: jboss AS 4.0.4 GA aop application deployment issue

kabir.khan@jboss.com do-not-reply at jboss.com
Fri Sep 22 12:05:56 EDT 2006


Sorry about the delay on this one. With the sample app you gave me it looks like you've used compile-time weaving?

It looks like you have used an old version of aop to do the aopc, since:

Decompiled code:

  | public class Car
  |     implements Advised
  | {
  |    ....
  |     private static MethodInfo aop$MethodInfo_calc5849500341557778326;
  |    ....
  | 

and since JBoss AOP 1.5.0 (which is used in JBoss 4.0.4.GA) this would have been woven as


  | public class Car
  |     implements Advised
  | {
  |    ....
  |     private static WeakReference aop$MethodInfo_calc5849500341557778326;
  |    ...
  | 

At runtime ClassAdvisor.initialiseMethods() in AOP 1.5.0 expects a field of type WeakReference


  |             Field infoField = clazz.getDeclaredField(MethodExecutionTransformer.getMethodInfoFieldName(amethod.getName(), keys));
  |             infoField.setAccessible(true);
  |             infoField.set(null, new WeakReference(info)); //point of failure
  | 

So, in short if doing compile-time weaving, make sure that you aopc your classes with the same version of JBoss AOP as you will be running them with. With loadtime weaving you avoid this problem :-)

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

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



More information about the jboss-user mailing list