在写Spring AOP 的时候,发现报了个错:org.springframework.beans.factory.BeanNotOfRequiredTypeException……
报错时我的注入方式是类注入
@Autowired
private PerformanceImpl performanceImpl;//类注入
改成接口注入方式:
@Autowired
private Performance performance;//接口注入
就可以通过测试了,原因是Spring的动态代理机制只支持接口注入