title: Spring AspectJ Style AOP
body: <p>I have a Java app that uses Spring, and I have the aspect</p>
  
  <pre><code>@Aspect
  public class MyAspect
  {
  
      @Pointcut("execution (* com.mycompany.MyClass.*(..))")
      public void doStuff() {}
  
      @Around("doStuff()")
      public Object aroundDoStuff(ProceedingJoinPoint pjp) throws Throwable
      {
          System.out.println("before doStuff);
        try
        {
          return pjp.proceed();
        }
        finally
        {
          System.out.println("after doStuff");
        }
    }
  }
  </code></pre>
  
  <p>Then my spring bean file has</p>
  
  <pre><code>&lt;aop:aspectj-autoproxy proxy-target-class="true" /&gt;
  &lt;bean id="MyAspect"
      class="com.mycompany.MyAspect" /&gt;
  </code></pre>
  
  <p>Now I would expect that all methods in MyClass get matched by the pointcut above, but that doesn't seem to be the case (only one of the methods seems to have the advice applied). I'm not sure if this has to do with the fact that I'm proxying a class or not, but does anyone see what I might be doing wrong here?</p>
  
  <p><strong>EDIT</strong>: The code is called from a main class that does something like this:</p>
  
  <pre><code>ApplicationContext cxt; // lookup the cxt
  MyClass mc = (MyClass) cxt.getBean("MyClassBean");
  mc.doSomething(); // I expect the advice to be applied here.
  </code></pre>
  
  <p>thanks,
  Jeff</p>