报错:
Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.lijianming.spring.aop.Impl.CalculatorImp] is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:318)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:985)
at com.lijianming.spring.aop.Impl.Main.main(Main.java:12)
在不添加<aop:aspectj-autoproxy>属性时,就不会出错。
后来把 [com.lijianming.spring.aop.Impl.CalculatorImp] 的父接口Calculate删掉(让它不继承至Calculate),就可以了,但是并不知道原因。