首页 > 移动平台 > 详细

idea中Could not autowire. No beans of 'xxxxMapper' type found.问题解决

时间:2019-07-04 19:37:17      阅读:5991      评论:0      收藏:0      [点我收藏+]

idea中Could not autowire. No beans of ‘xxxxMapper‘ type found.问题解决

解决方案:

建议给Mapper增加@Repository注解,并加入包名到spring配置文件的扫描范围

技术分享图片

技术分享图片

不建议降低idea的Autowired检测级别

问题复现:

 技术分享图片

说明:

Mapper不需要标注@Repository注解并且无需实现类,是因为mybatis的xml配置文件配置了Mapper工厂,Mapper接口会自动生成实现类,并交由Spring管理。

技术分享图片

 

idea中Could not autowire. No beans of 'xxxxMapper' type found.问题解决

原文:https://www.cnblogs.com/innerserenity/p/11134075.html

(1)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!