title: SpringAOP, load-time-weaver, strange behavior
body: <p>in this moment i am facing one problem and really dont know what i am doing wrong. I am coding logging for my webservice using Spring framework and AOP in @AspectJ style. I got two bundles - background and frontend. In background bundle I have LogAspect, which look like this:</p>
  
  <pre><code>@Aspect
  public class LogAspect {
      @Pointcut("@annotation(logMethod)")
      public void logMethodAnnotated(LogMethod logMethod){}
  
      @Before("logMethodAnnotated(logMethod)")
      public void beforeLogMethodAnnotated(JoinPoint jp){
          //actions
      }
  
      @After("logMethodAnnotated(logMethod)")
      public void afterLogMethodAnnotated(JoinPoint jp){
          //actions   
      }
  }
  </code></pre>
  
  <p>and META-INF/spring/background-osgi.xml:</p>
  
  <pre><code>&lt;context:annotation-config /&gt;
  &lt;context:component-scan base-package="simon.background"/&gt;
  
  &lt;context:load-time-weaver /&gt;   
  </code></pre>
  
  <p>and also META-INF/aop.xml:</p>
  
  <pre><code>&lt;!DOCTYPE aspectj PUBLIC
          "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd"&gt;
  &lt;aspectj&gt;
  
      &lt;weaver&gt;
  
          &lt;!-- only weave classes in our application-specific packages --&gt;
          &lt;include within="simon.background.*"/&gt;
          &lt;include within="simon.frontend.controller.*"/&gt;
  
      &lt;/weaver&gt;
  
      &lt;aspects&gt;
  
          &lt;!-- weave in just this aspect --&gt;        
          &lt;aspect name="simon.background.log.LogAspect"/&gt;
  
      &lt;/aspects&gt;
  
    &lt;/aspectj&gt;
  </code></pre>
  
  <p>In frontend bundle I've just put into aplicationContext.xml <code>&lt;context:load-time-weaver aspectj-weaving="on" /&gt;</code>. But the code is acting very strange. I found out, that there is some problem, when I put into my advice methods JoinPoint as argument. (I mean, when I got advice methods without arguments, so there were no JoinPoin in method header, everything has been working fine and advices has been running before and after @LogMethod (my annotation, which I use to say, that i want to log this method) annotated methods). But now it is working like this:
  - when I start server and so that the bundles are deployed for the first time, then the advices are run just for methods, they are @LogMethod annotated and belongs to background bundle, but not for annotated methods in frontend.controller.
  - and in addition, when I have done some changes in one of my controllers, saved it and deployed just frontend bundle, then when I run @LogMethod annotated method, I got this error: </p>
  
  <p>org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.LinkageError: loader constraint violation: when resolving method "simon.background.log.LogAspect.afterLogMethodAnnotated(Lorg/aspectj/lang/JoinPoint;)V" the class loader (instance of com/springsource/kernel/userregion/internal/equinox/KernelBundleClassLoader) of the current class, simon/frontend/controller/HuhController, and the class loader (instance of com/springsource/kernel/userregion/internal/equinox/KernelBundleClassLoader) for resolved class, simon/background/log/LogAspect, have different Class objects for the type /aspectj/lang/JoinPoint;)V used in the signature</p>
  
  <p>Any ideas what is going on and how can i fix it, so my program will be able to run advices correctly?</p>
  
  <p>One additional note, it could maybe help: When I run this in Debug mode with advices without JoinPoint argument, I realized, that both advices were running twice for one method.</p>