title: Spring autowiring not working with proxies
body: <p>Here are my spring configuration files and classes:- </p>
  
  <p>I am not able to autowire the proxied class in test Service. After running Test.java I am getting NullPointerException obviously property 'arthmeticCalculator' is not set.</p>
  
  <p>I am not getting whats going wrong? Please help me to solve this problem.</p>
  
  <pre><code>&lt;bean id="arthmeticCalculator" class="com.manoj.aop.test.CalculatorImpl"/&gt;
  &lt;bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"&gt;
    &lt;property name="beanNames"&gt;
          &lt;list&gt;
          &lt;value&gt;*Calculator&lt;/value&gt;
          &lt;/list&gt;
    &lt;/property&gt;
    &lt;property name="interceptorNames"&gt;
          &lt;list&gt;
          &lt;value&gt;methodNameAdvisor&lt;/value&gt;
          &lt;/list&gt;
    &lt;/property&gt;
  &lt;/bean&gt;
  &lt;bean id="methodNameAdvisor" class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor"&gt;
      &lt;property name="mappedNames"&gt;
          &lt;list&gt;
              &lt;value&gt;add&lt;/value&gt;
              &lt;value&gt;sub&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name="advice" ref="loggingAroundAdvice" /&gt;
  &lt;/bean&gt;
  &lt;bean id="loggingAroundAdvice" class="com.manoj.aop.test.LoggingAroundAdvice"/&gt;
  &lt;bean id="testService" class="com.manoj.aop.test.TestService"&gt;
  
  &lt;/bean&gt;
  </code></pre>
  
  <p>Calculator.java:-</p>
  
  <pre><code>public interface Calculator {
  
      public double add(double a,double b);
  }
  </code></pre>
  
  <p>CacculatorImpl:-</p>
  
  <pre><code>public class CalculatorImpl implements Calculator {
  
      public double add(double a, double b) {
          return a+b;
      }    
  }
  </code></pre>
  
  <p>LoggingAroundAdvice:-</p>
  
  <pre><code>public class LoggingAroundAdvice implements MethodInterceptor{
  
  
      public Object invoke(MethodInvocation methodInvocation) throws Throwable {
          System.out.println("Around Invoice called");
          Object result = methodInvocation.proceed();
          return result;
      }
  
  }
  </code></pre>
  
  <p>TestService:-</p>
  
  <pre><code>public class TestService {
  
      @Autowired
       private Calculator  arthmeticCalculator;
  
  
       public void test(){
           System.out.println(arthmeticCalculator.add(5, 10.5));
       }  
  }
  </code></pre>
  
  <p>Test.java:-</p>
  
  <pre><code>public class Test {    
      /**
       * @param args
       */
      public static void main(String[] args) {
          ApplicationContext context = new ClassPathXmlApplicationContext("com/manoj/aop/test/aop.xml");
          TestService service = (TestService) context.getBean("testService");
          service.test();
      }  
  }
  </code></pre>