使用Mybatis-Plus时,注入mapper提示Could not autowire. No beans of 'xxxMapper' type found.的解决方案


如图

使用Mybatis-Plus时,注入mapper提示Could not autowire. No beans of ‘xxxMapper‘ type found._.net

Tips

此报红不影响项目的正常运行
  • 1

解决方案

  1. 降低IDEA报错的等级
    使用Mybatis-Plus时,注入mapper提示Could not autowire. No beans of ‘xxxMapper‘ type found._正常运行_02
    虽然依然提示Could not autowire,但是不报红使用Mybatis-Plus时,注入mapper提示Could not autowire. No beans of ‘xxxMapper‘ type found._bug_03

2.在Mapper接口上添加 @Component(value = “xxxMapper”)注解

使用Mybatis-Plus时,注入mapper提示Could not autowire. No beans of ‘xxxMapper‘ type found._java_04

此时就不再提示Could not autowire. No beans of ‘xxxMapper’ type found。使用Mybatis-Plus时,注入mapper提示Could not autowire. No beans of ‘xxxMapper‘ type found._java_05


看到最后的帮忙

点个赞???????? 谢谢,这个对我真的很重要!

使用Mybatis-Plus时,注入mapper提示Could not autowire. No beans of ‘xxxMapper‘ type found._解决方案_06