您的位置:首页 > 编程语言 > Java开发

"org.springframework.beans.factory.BeanNotOfRequiredTypeException……" 错误解决方案

2017-03-01 09:08 507 查看
在写Spring AOP 的时候,发现报了个错:org.springframework.beans.factory.BeanNotOfRequiredTypeException……

报错时我的注入方式是类注入

@Autowired
private PerformanceImpl performanceImpl;//类注入
改成接口注入方式:
@Autowired
private Performance performance;//接口注入
就可以通过测试了,原因是Spring的动态代理机制只支持接口注入
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐