解决:Field xxMapper in xx.service.impl.xxServiceImpl required a bean of type 'xx.mapper.xxMapper'...报错原因,是因为项目未扫描到 mapper 包。

  • 解决方法:

  • 在项目启动类上加注解 @MapperScan(“Mapper文件所在的包”),@MapperScan 是扫描mapper类的注解,就不用在每个mapper类上加@MapperScan了。

  • 重启工程成功运行。

相关文章:

  • 2021-08-02
  • 2021-12-05
  • 2021-06-06
  • 2021-12-09
  • 2021-05-08
  • 2021-12-26
  • 2022-12-23
  • 2021-09-13
猜你喜欢
  • 2021-10-21
  • 2022-12-23
  • 2021-07-21
  • 2021-04-02
  • 2021-04-06
相关资源
相似解决方案