A component required a bean of type 'com.example...' that could not be found解決辦法


工程啟動報錯
A component required a bean of type ‘com.example…’ that could not be found

 

解決辦法一:
1、再啟動類添加mapper包掃描注解即可
@MapperScan(“com.example.firstspringboot.dao”)
在這里插入圖片描述

解決辦法二:
在每個mapper接口上添加@mapper注解
在這里插入圖片描述

 

轉載自:https://blog.csdn.net/qq_34206683/article/details/86179789


免責聲明!

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



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