一、Field userMapper in com.yanan.outjob.controller.SysUserController required a bean of type 'com.yanan.outjob.dao.SysUserMapper' that could not be found.app
mapper注入失敗ui
解決方法啓動類添加掃描註解 @MapperScan("com.yanan.outjob.dao")spa
二、配置多個數據源報錯(more than one 'primary' bean found among candidates).net
控制檯輸出:more than one 'primary' bean found among candidates: code
很明顯,出現了不止一個的「primary」,找出primary出現的位置。多個數據源配置文件在其中兩個文件中用到了blog
@Primary註解,試着刪掉其中一個文件中的@Primary註解,項目正常啓動
借鑑:https://blog.csdn.net/weixin_42074377/article/details/83615895