springboot 數據庫出現 Consider defining a bean of type 'com.jc.wechat.app.dao.ClientRepository' in your configuration. 解決辦法


錯誤日志完整:

  

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-01-02 12:50:10.767 ERROR 8624 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :

***************************
APPLICATION FAILED TO START
***************************

Description:

Field clientRepository in com.jc.wechat.app.service.impl.ClientServiceImpl required a bean of type 'com.jc.wechat.app.dao.ClientRepository' that could not be found.

The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'com.jc.wechat.app.dao.ClientRepository' in your configuration.


Process finished with exit code 1

解決辦法:

在框架的啟動文件加入掃描包路徑

@ComponentScan(basePackages = "com.jc.wechat.app.dao") //引入dao根路徑


免責聲明!

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



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