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根路径

springboot 数据库出现 Consider defining a bean of type 'com.jc.wechat.app.dao.ClientRepository' in your configuration. 解决办法

原文地址:https://www.cnblogs.com/pxjbk/p/12132336.html

时间: 2024-10-13 13:59:35

springboot 数据库出现 Consider defining a bean of type 'com.jc.wechat.app.dao.ClientRepository' in your configuration. 解决办法的相关文章

Consider defining a bean of type 'package' in your configuration [Spring-Boot]

https://stackoverflow.com/questions/40384056/consider-defining-a-bean-of-type-package-in-your-configuration-spring-boot Your Applicant class is not scanned it seems. By default all packages starting with the root as the class where you have put @Spri

springboot 工程启动报错之Consider defining a bean of type ‘XXX’ in your configuration.

一.前言: 使用springboot自动注入的方式搭建好了工程,结果启动的时候报错了!!!,错误如下图: Description: Field userEntityMapper in com.xxx.xxx.service.UserService required a bean of type 'com.xxx.xxx.dao.UserEntityMapper' that could not be found. Action: Consider defining a bean of type '

Consider defining a bean of type 'com.lvjing.dao.DeviceStatusMapper' in your configuration.

"C:\Program Files\Java\jdk1.8.0_181\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.4\lib\idea_rt.jar=55273:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.4\bin" -Dfile.enc

Consider defining a bean of type `xxx` in your configuration问题解决问题解决

在使用SpringBoot装配mybatis时出现了异常 *************************** APPLICATION FAILED TO START *************************** Description: Field studentService in com.example.demo.action.StudentController required a bean of type 'com.example.demo.service.StudentS

【spring boot】mybatis启动报错:Consider defining a bean of type 'com.newhope.interview.dao.UserMapper' in your configuration.

启动报错: 2018-02-24 22:41:00.442 WARN 2952 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error c

spring boot注入error,Consider defining a bean of type 'xxx' in your configuration问题解决方案

经常出现这问题一定是非spring生态圈的@标签 没被spring引入,如mybatis等 因为在默认情况下只能扫描与控制器在同一个包下以及其子包下的@Component注解,以及能将指定注解的类自动注册为Bean的@[email protected]和@ Repository 那个这个时候就需要@ComponentScan或者@MapperScan了 要是xml配置注入有这问题,麻烦一遍一遍看xml文件的配置,绝对是哪里没写匹配. spring boot注入error,Consider def

启动项目,编译报错:Consider defining a bean of type 'XXX' in your configuration.

在controller层注入ConfigBean,编译器报错: 一开是以为是intellij idea 的告警级别设定的问题,就没有在意,继续启动项目,结果控制台报错:Consider defining a bean of type 'XXX' in your configuration. 错误信息显示找不到这个Bean类. 但是我明明写了啊. 后来经过一番查找,大概有了如下理解:主要问题出在@SpringBootApplication 这个注解上. 点进这个注解,可以看到,此注解功能大概由下面

onsider defining a bean of type 'org.springframework.jms.core.JmsTemplate' in your configuration.

启动是报没有找到这个bean的错误 第一个想就是这个JmsTemplate类加载没有, 其次是我的依赖错没有, 进过仔细检查和网上查询资料以后发现我的依赖这些注解这些是没有问题的 然后,我就很迷了,我就问了同事,他就说我的版本会不会有问题,我就看了一下我的版本,是2.1的,而2.1版本和2.0版本对于mq是有很大的区别的 onsider defining a bean of type 'org.springframework.jms.core.JmsTemplate' in your confi

Java AOP nested exception is java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice || Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0' 两个异常解决办法

贴出applicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://ww