title: injected instance variables are null on aspect execution
body: <p>I have this odd problem with Spring AOP and I am hoping someone can shed some light on it.</p>
  
  <p>I am using CGLIB proxies and when I execute the following aspect i get a null pointer:</p>
  
  <pre><code>@Aspect
  @Component //i.e. Singleton
  public class MyAspect {
  
      private static final Logger logger = LoggerFactory.getLogger(MyAspect.class);
  
      {
  
          logger.debug("new instance of MyAspect");  //Line 1
      }
  
      private AutowireCapableBeanFactory factory;
  
      @Inject
      public MyAspect(AutowireCapableBeanFactory factory) {
  
          if (factory ==null) {
  
              logger.debug("your factory is null");  //Line 2
          } else {
  
              logger.debug("your factory is not null");
          }
          this.factory = factory;
      }
  
      @AfterReturning(pointcut = "@annotation(com.domain.annotations.MyAnnotation)")
      public void doSomething() {
  
          if (factory ==null) {
  
              logger.debug("your factory is null again");  //Line 3
          }
  
                      // this is a request scoped bean
          MyRequest request = factory.getBean(MyRequest.class);  //Line 4
  
  
  
          if (request != null) {
              logger.debug("No");
              }
          else {
              logger.debug("Yes");
              }
      }
  }
  </code></pre>
  
  <p>I am getting a NullPointerException at Line 4.  I can see that the "factory" is null at Line 3 but it is not null when the instance is create at Line 2.  I am also tracking the instances being created at Line 1.  </p>
  
  <p>This design works using interfaces (JDK dynamic proxies). Why do my instances variables become null at runtime and is there a work around to this?</p>