问题描述

在用MyBatis的注解方式来配置Mapper接口的时候 注入到类里 就遇到了这个Could not autowire. No beans of ‘XXXMapper’ type found的错误提示
其实还有很多情况都会报这样的错误提示(Spring太方便了
程序的编译和运行都是没有问题的 这个错误提示并不会产生影响
但对于强迫症的我来说 红色的提示属实有点碍眼
IDEA下解决Spring的Could not autowire. No beans of 'XXXMapper' type found. more... (Ctrl+F1)

原因

两种情况 要么是真的导入了错误的包
要么就是在某些框架下确实不需要配置对应的bean 例如MyBatis

解决方法

主界面左上角File - Settings - Editor - Inspections
IDEA下解决Spring的Could not autowire. No beans of 'XXXMapper' type found. more... (Ctrl+F1)
修改成Warning之后 就只会有黄色小框了


相关文章:

  • 2021-10-11
  • 2022-12-23
  • 2021-12-19
  • 2021-06-10
  • 2021-09-16
  • 2022-12-23
  • 2021-07-04
  • 2021-08-13
猜你喜欢
  • 2021-12-14
  • 2021-07-01
  • 2021-06-21
  • 2021-06-14
  • 2021-07-29
  • 2021-11-03
  • 2021-04-23
相关资源
相似解决方案