Unsatisfied dependency expressed through field 'XXXMapper'; nested exception is org.springframework.beans.factory


Unsatisfied dependency expressed through field 'XXXMapper'; nested exception is org.springframework.beans.factory

今天我在springboot整合mybatisPlus時遇到在service層 自動注入 Usermapper時遇到這個錯誤

,網上常見的幾個方法都試了,都不行

大家如果都試了不行可以試試我這個:

  1. 把mybatisPlus生成的文件全部刪除,目錄也刪除,重新生成

  2. 在啟動類中配置你生成的mapper所在的包@MapperScan(value = "com.bing.mapper")

這樣就把第一個錯誤解決了,然后買一送一

Database 出錯

很奇怪,我已經還原不出案發現場了

就是把 yaml中的數據庫url

和 generatorConfig.xml 中的調整一下

都設置成false


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM