1、Field userMapper in com.yanan.outjob.controller.SysUserController required a bean of type 'com.yanan.outjob.dao.SysUserMapper' that could not be found.

  mapper注入失败

  解决方法启动类添加扫描注解 @MapperScan("com.yanan.outjob.dao")

springboot-遇到的错误

 2、配置多个数据源报错(more than one 'primary' bean found among candidates)

   控制台输出:more than one 'primary' bean found among candidates: 

  很明显,出现了不止一个的“primary”,找出primary出现的位置。多个数据源配置文件在其中两个文件中用到了

@Primary注解,试着删掉其中一个文件中的@Primary注解,项目正常启动
借鉴:https://blog.csdn.net/weixin_42074377/article/details/83615895

相关文章:

  • 2021-10-18
  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
  • 2021-10-11
  • 2021-08-09
  • 2021-08-05
  • 2021-09-04
猜你喜欢
  • 2021-12-20
  • 2021-07-13
  • 2021-05-03
  • 2021-07-29
  • 2021-12-31
相关资源
相似解决方案