** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.

这个问题比较坑的

解决方法就是不能在 src/java 目录下面直接创建启动类,必须先创建包, 将类放入包里面

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:/Users/mac/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.2.1.RELEASE/spring-boot-autoconfigure-2.2.1.RELEASE.jar!/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration.class]; nested exception is java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration due to org/springframework/dao/DataAccessException not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:454) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:316) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:276) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:132) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:290) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:202) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:170) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:325) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:242) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]at AppStart.main(AppStart.java:15) [classes/:na]
Caused by: java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration due to org/springframework/dao/DataAccessException not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:54) ~[spring-boot-autoconfigure-2.2.1.RELEASE.jar:2.2.1.RELEASE]at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:88) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:71) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.isConditionMatch(ClassPathScanningCandidateComponentProvider.java:515) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.isCandidateComponent(ClassPathScanningCandidateComponentProvider.java:498) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:431) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]... 20 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/springframework/dao/DataAccessExceptionat org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseCondition.getMatchOutcome(DataSourceAutoConfiguration.java:128) ~[spring-boot-autoconfigure-2.2.1.RELEASE.jar:2.2.1.RELEASE]at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[spring-boot-autoconfigure-2.2.1.RELEASE.jar:2.2.1.RELEASE]... 26 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataAccessExceptionat java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_221]at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_221]at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[na:1.8.0_221]at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_221]... 28 common frames omitted

SpringBoot启动报错 Failed to read candidate component class:相关推荐

  1. 解决IntelliJ IDEA报错Failed to read candidate component class: file [ ]; nested exception is org.

    解决IntelliJ IDEA报错Failed to read candidate component class: file [ ]; nested exception is org.springf ...

  2. 【已解决】Springboot服务 Netty启动报错Failed to submit a listener

    [已解决]Springboot服务 Netty启动报错Failed to submit a listener Force-closing a channel whose registration ta ...

  3. SpringBoot启动报错Could not resolve placeholder ‘XXX.XXX‘ in value

    SpringBoot启动项目时报错: Exception encountered during context initialization - cancelling refresh attempt: ...

  4. SpringBoot启动报错:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean

    SpringBoot启动报错:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean ...

  5. springboot启动报错Logbook

    springboot启动报错 APPLICATION FAILED TO START Description: Field logbookHttpRequestInterceptor in com.j ...

  6. springboot启动报错:Unregistering JMX-exposed beans on shutdown

    环境 1,maven 3.5.0 2,eclipse 4.7.1 3,spring boot 1.5.9.RELEASE springboot启动报错 按照spring 用户手册创建新的spring ...

  7. SpringBoot启动报错:Parameter 0 of method hmset in com.qcby.rbac.util.RedisUtils required a bean of type

    SpringBoot启动报错,报错信息如下: 报错是由于A类中定义了含参数的构造函数,Spring自动构造和注入时未为该Bean传入参数,引起报错. 查了很多资料,最后发现,我是因为注释的时候没有把@ ...

  8. 启动Spring项目报错,Springboot启动报错 Disconnected from the target VM 解决过程

    启动Spring项目报错,Springboot启动报错 Disconnected from the target VM 解决过程 大概率是缺少了一下依赖 <dependency><g ...

  9. IDEA springboot启动报错java.lang.UnsatisfiedLinkError: no tcnative-1 in java.library.path

    IDEA springboot启动报错: java.lang.UnsatisfiedLinkError: no tcnative-1 in java.library.path: [D:\Java\bi ...

最新文章

  1. 如何使用TensorRT对训练好的PyTorch模型进行加速?
  2. 2021-7-20 Linux服务器终端terminals关不掉怎么办???
  3. 区块链论文8,NIPoPoWs,非交互工作量证明之证明
  4. 为什么叫python编程-Python这么火,为什么说它不是未来的编程语言?
  5. linux 下基于jrtplib库的实时传送实现
  6. JDK中DNS缓存的分析
  7. Tomcat的Session管理(三)
  8. 飞步科技三篇论文入选CVPR 2022
  9. cdn共振为什么要拍身份证_干货 | 拍婚纱照为什么要提前预约呢?
  10. gradle 修改java代码_自定义一个gradle插件动态修改jar包Class文件
  11. android fastboot原理,FastBoot使用一
  12. Entity Framework使用Sqlite时的一些配置
  13. 导入项目后资源文件乱码---eclipse插件properties Editor安装
  14. 射频功率放大器 RF放大器概念
  15. php微信公众平台关注后欢迎语的设置,关注公众号的欢迎语怎么设置?公众号欢迎语怎么加链接?...
  16. 微软必应词典客户端的案例分析——个人Week3作业
  17. 督查督办管理平台系统
  18. 微信网页开发——随手笔记
  19. Set? set和Set set的区别?
  20. Web 实时消息推送详解

热门文章

  1. c语言自动随机发牌给四个人(没有大小王)
  2. ipone6界面设计标准
  3. Python使用Pandas计算相关系数
  4. android日期分组相册,按时间分类的自定义相册
  5. java.lang.IllegalStateException: Ambiguous handler methods
  6. 生信自学笔记(五)计分矩阵的实例
  7. 进程互斥锁,队列,IPC进程间通信,生产者与消费者,线程,线程对象的属性,先行互斥锁...
  8. 2012意大利之行1:从深圳到罗马
  9. GitHub快速学习-一
  10. 笔记本电脑插过一次typeC的耳机之后在插3.5的圆孔耳机不能用?