springboot 数据库出现 Consider defining a bean of type 'com.jc.wechat.app.dao.ClientRepository' i
Posted 人工智障
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了springboot 数据库出现 Consider defining a bean of type 'com.jc.wechat.app.dao.ClientRepository' i相关的知识,希望对你有一定的参考价值。
错误日志完整:
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根路径
以上是关于springboot 数据库出现 Consider defining a bean of type 'com.jc.wechat.app.dao.ClientRepository' i的主要内容,如果未能解决你的问题,请参考以下文章
springboot 工程启动报错之Consider defining a bean of type ‘XXX’ in your configuration.
SpringBoot启动报错“Consider defining a bean of type ‘xxx.mapper.UserMapper‘ in your configuration.“(代码片段
nodejs 连接 mysql 出现 Client does not support authentication protocol requested by server; consider upg
Consider defining a bean of type `xxx` in your configuration问题解决问题解决
Spring Boot @Autowired无法注入类 Consider defining a bean of type
php-fpm: 某项目网站频繁出现503问题解决( WARNING: [pool www] server reached pm.max_children setting (50), consider