最近使用spring boot+mybatis时出现了这个错误;

spring boot 报错Could not autowire. No beans of 'BookMapper' type found. less... (Ctrl+F1)

看IDEA的提示是这个mapper接口没有被注入,不是一个bean,看百度很多人都说是在IDEA中降低提示级别,这种方法只能让你看不到报红,熟悉@Autowired注解就知道怎么解决了,

spring boot 报错Could not autowire. No beans of 'BookMapper' type found. less... (Ctrl+F1)

我们在mapper接口上添加@Component注解,然后就没问题了:

spring boot 报错Could not autowire. No beans of 'BookMapper' type found. less... (Ctrl+F1)

相关文章:

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