前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Error starting ApplicationContext. To display the conditions report re-run your application with

Error starting ApplicationContext. To display the conditions report re-run your application with

作者头像
猫头虎
发布2024-04-07 17:10:17
6350
发布2024-04-07 17:10:17
举报
文章被收录于专栏:猫头虎博客专区

SpringBoot 项目启动报错,错误信息如下:

代码语言:javascript
复制
/*
* 提示:该行代码过长,系统自动注释不进行高亮。一键复制会移除系统注释 
* D:\Java\jdk_8_windows_x64\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -javaagent:D:\JAVA_EE\ideaIU_2018_3_6_win\lib\idea_rt.jar=11566:D:\JAVA_EE\ideaIU_2018_3_6_win\bin -Dfile.encoding=UTF-8 -classpath "D:\Java\jdk_8_windows_x64\jre\lib\charsets.jar;D:\Java\jdk_8_windows_x64\jre\lib\deploy.jar;D:\Java\jdk_8_windows_x64\jre\lib\ext\access-bridge-64.jar;D:\Java\jdk_8_windows_x64\jre\lib\ext\cldrdata.jar;D:\Java\jdk_8_windows_x64\jre\lib\ext\dnsns.jar;D:\Java\jdk_8_windows_x64\jre\lib\ext\jaccess.jar;D:\Java\jdk_8_windows_x64\jre\lib\ext\jfxrt.jar;D:\Java\jdk_8_windows_x64\jre\lib\ext\localedata.jar;D:\Java\jdk_8_windows_x64\jre\lib\ext\nashorn.jar;D:\Java\jdk_8_windows_x64\jre\lib\ext\sunec.jar;D:\Java\jdk_8_windows_x64\jre\lib\ext\sunjce_provider.jar;D:\Java\jdk_8_windows_x64\jre\lib\ext\sunmscapi.jar;D:\Java\jdk_8_windows_x64\jre\lib\ext\sunpkcs11.jar;D:\Java\jdk_8_windows_x64\jre\lib\ext\zipfs.jar;D:\Java\jdk_8_windows_x64\jre\lib\javaws.jar;D:\Java\jdk_8_windows_x64\jre\lib\jce.jar;D:\Java\jdk_8_windows_x64\jre\lib\jfr.jar;D:\Java\jdk_8_windows_x64\jre\lib\jfxswt.jar;D:\Java\jdk_8_windows_x64\jre\lib\jsse.jar;D:\Java\jdk_8_windows_x64\jre\lib\management-agent.jar;D:\Java\jdk_8_windows_x64\jre\lib\plugin.jar;D:\Java\jdk_8_windows_x64\jre\lib\resources.jar;D:\Java\jdk_8_windows_x64\jre\lib\rt.jar;D:\JAVA_SE\第四阶段\5 Vue\code\vue-ems\vuecrud\target\classes;D:\Java\MavenRepository\org\springframework\boot\spring-boot-starter-web\2.2.5.RELEASE\spring-boot-starter-web-2.2.5.RELEASE.jar;D:\Java\MavenRepository\org\springframework\boot\spring-boot-starter\2.2.5.RELEASE\spring-boot-starter-2.2.5.RELEASE.jar;D:\Java\MavenRepository\org\springframework\boot\spring-boot\2.2.5.RELEASE\spring-boot-2.2.5.RELEASE.jar;D:\Java\MavenRepository\org\springframework\boot\spring-boot-autoconfigure\2.2.5.RELEASE\spring-boot-autoconfigure-2.2.5.RELEASE.jar;D:\Java\MavenRepository\org\springframework\boot\spring-boot-starter-logging\2.2.5.RELEASE\spring-boot-starter-logging-2.2.5.RELEASE.jar;D:\Java\MavenRepository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\Java\MavenRepository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\Java\MavenRepository\org\apache\logging\log4j\log4j-to-slf4j\2.12.1\log4j-to-slf4j-2.12.1.jar;D:\Java\MavenRepository\org\apache\logging\log4j\log4j-api\2.12.1\log4j-api-2.12.1.jar;D:\Java\MavenRepository\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;D:\Java\MavenRepository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;D:\Java\MavenRepository\org\yaml\snakeyaml\1.25\snakeyaml-1.25.jar;D:\Java\MavenRepository\org\springframework\boot\spring-boot-starter-json\2.2.5.RELEASE\spring-boot-starter-json-2.2.5.RELEASE.jar;D:\Java\MavenRepository\com\fasterxml\jackson\core\jackson-databind\2.10.2\jackson-databind-2.10.2.jar;D:\Java\MavenRepository\com\fasterxml\jackson\core\jackson-annotations\2.10.2\jackson-annotations-2.10.2.jar;D:\Java\MavenRepository\com\fasterxml\jackson\core\jackson-core\2.10.2\jackson-core-2.10.2.jar;D:\Java\MavenRepository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.10.2\jackson-datatype-jdk8-2.10.2.jar;D:\Java\MavenRepository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.10.2\jackson-datatype-jsr310-2.10.2.jar;D:\Java\MavenRepository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.10.2\jackson-module-parameter-names-2.10.2.jar;D:\Java\MavenRepository\org\springframework\boot\spring-boot-starter-tomcat\2.2.5.RELEASE\spring-boot-starter-tomcat-2.2.5.RELEASE.jar;D:\Java\MavenRepository\org\apache\tomcat\embed\tomcat-embed-core\9.0.31\tomcat-embed-core-9.0.31.jar;D:\Java\MavenRepository\org\apache\tomcat\embed\tomcat-embed-el\9.0.31\tomcat-embed-el-9.0.31.jar;D:\Java\MavenRepository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.31\tomcat-embed-websocket-9.0.31.jar;D:\Java\MavenRepository\org\springframework\boot\spring-boot-starter-validation\2.2.5.RELEASE\spring-boot-starter-validation-2.2.5.RELEASE.jar;D:\Java\MavenRepository\jakarta\validation\jakarta.validation-api\2.0.2\jakarta.validation-api-2.0.2.jar;D:\Java\MavenRepository\org\hibernate\validator\hibernate-validator\6.0.18.Final\hibernate-validator-6.0.18.Final.jar;D:\Java\MavenRepository\org\jboss\logging\jboss-logging\3.4.1.Final\jboss-logging-3.4.1.Final.jar;D:\Java\MavenRepository\com\fasterxml\classmate\1.5.1\classmate-1.5.1.jar;D:\Java\MavenRepository\org\springframework\spring-web\5.2.4.RELEASE\spring-web-5.2.4.RELEASE.jar;D:\Java\MavenRepository\org\springframework\spring-beans\5.2.4.RELEASE\spring-beans-5.2.4.RELEASE.jar;D:\Java\MavenRepository\org\springframework\spring-webmvc\5.2.4.RELEASE\spring-webmvc-5.2.4.RELEASE.jar;D:\Java\MavenRepository\org\springframework\spring-aop\5.2.4.RELEASE\spring-aop-5.2.4.RELEASE.jar;D:\Java\MavenRepository\org\springframework\spring-context\5.2.4.RELEASE\spring-context-5.2.4.RELEASE.jar;D:\Java\MavenRepository\org\springframework\spring-expression\5.2.4.RELEASE\spring-expression-5.2.4.RELEASE.jar;D:\Java\MavenRepository\mysql\mysql-connector-java\5.1.49\mysql-connector-java-5.1.49.jar;D:\Java\MavenRepository\org\mybatis\spring\boot\mybatis-spring-boot-starter\2.1.4\mybatis-spring-boot-starter-2.1.4.jar;D:\Java\MavenRepository\org\springframework\boot\spring-boot-starter-jdbc\2.2.5.RELEASE\spring-boot-starter-jdbc-2.2.5.RELEASE.jar;D:\Java\MavenRepository\com\zaxxer\HikariCP\3.4.2\HikariCP-3.4.2.jar;D:\Java\MavenRepository\org\springframework\spring-jdbc\5.2.4.RELEASE\spring-jdbc-5.2.4.RELEASE.jar;D:\Java\MavenRepository\org\springframework\spring-tx\5.2.4.RELEASE\spring-tx-5.2.4.RELEASE.jar;D:\Java\MavenRepository\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\2.1.4\mybatis-spring-boot-autoconfigure-2.1.4.jar;D:\Java\MavenRepository\org\mybatis\mybatis\3.5.6\mybatis-3.5.6.jar;D:\Java\MavenRepository\org\mybatis\mybatis-spring\2.0.6\mybatis-spring-2.0.6.jar;D:\Java\MavenRepository\com\alibaba\druid\1.2.5\druid-1.2.5.jar;D:\Java\MavenRepository\org\projectlombok\lombok\1.18.12\lombok-1.18.12.jar;D:\Java\MavenRepository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;D:\Java\MavenRepository\org\springframework\spring-core\5.2.4.RELEASE\spring-core-5.2.4.RELEASE.jar;D:\Java\MavenRepository\org\springframework\spring-jcl\5.2.4.RELEASE\spring-jcl-5.2.4.RELEASE.jar;D:\Java\MavenRepository\org\springframework\boot\spring-boot-configuration-processor\2.2.5.RELEASE\spring-boot-configuration-processor-2.2.5.RELEASE.jar" VuecrudApplication
*/

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.5.RELEASE)

2021-07-04 17:34:17.776  INFO 17348 --- [           main] VuecrudApplication                       : Starting VuecrudApplication on JAVA with PID 17348 (started by Admin in D:\JAVA_SE\第四阶段\5 Vue\code\vue-ems)
2021-07-04 17:34:17.783  INFO 17348 --- [           main] VuecrudApplication                       : No active profile set, falling back to default profiles: default
2021-07-04 17:34:17.983  WARN 17348 --- [           main] ionWarningsApplicationContextInitializer : 

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


2021-07-04 17:34:35.908  WARN 17348 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [VuecrudApplication]; nested exception is java.lang.IllegalArgumentException: Could not find class [org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration]
2021-07-04 17:34:35.916  INFO 17348 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-07-04 17:34:35.925 ERROR 17348 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [VuecrudApplication]; nested exception is java.lang.IllegalArgumentException: Could not find class [org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration]
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:188) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:319) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:236) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at VuecrudApplication.main(VuecrudApplication.java:11) [classes/:na]
Caused by: java.lang.IllegalArgumentException: Could not find class [org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration]
	at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:332) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.core.annotation.TypeMappedAnnotation.adapt(TypeMappedAnnotation.java:481) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.core.annotation.TypeMappedAnnotation.getValue(TypeMappedAnnotation.java:401) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.core.annotation.TypeMappedAnnotation.asMap(TypeMappedAnnotation.java:286) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.core.annotation.AbstractMergedAnnotation.asAnnotationAttributes(AbstractMergedAnnotation.java:193) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.core.type.AnnotatedTypeMetadata.getAnnotationAttributes(AnnotatedTypeMetadata.java:106) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.annotation.AnnotationConfigUtils.attributesFor(AnnotationConfigUtils.java:285) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.annotation.AnnotationBeanNameGenerator.determineBeanNameFromAnnotation(AnnotationBeanNameGenerator.java:98) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.annotation.AnnotationBeanNameGenerator.generateBeanName(AnnotationBeanNameGenerator.java:77) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:280) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:132) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:295) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:249) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:206) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:174) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	... 13 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_291]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_291]
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) ~[na:1.8.0_291]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_291]
	at java.lang.Class.forName0(Native Method) ~[na:1.8.0_291]
	at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_291]
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:282) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:322) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	... 27 common frames omitted


Process finished with exit code 1

解决方案:

代码语言:javascript
复制
Error starting ApplicationContext. To display the conditions report re-run your application with

入口类放的位置不对,注意查看文件结构:

正确:

错误:

小区别,很难发现哦!

问题解决方案:

如果你在启动应用时遇到 “Error starting ApplicationContext” 错误,请按照以下步骤重新运行你的应用程序:

  1. 首先,检查你的入口类的位置是否正确。请注意查看你的文件结构。

正确的文件结构应该如下所示:

错误的文件结构示例:

请注意,这两者之间存在细微差别,但却很难发现。

通过仔细对比上述示例,确保你的项目文件结构与“正确文件结构示例”一致,以避免出现启动错误。

这些步骤有助于解决启动应用时可能遇到的问题,希望能对你有所帮助!如有疑问,请随时向我提问。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2023-08-11,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • SpringBoot 项目启动报错,错误信息如下:
  • 解决方案:
  • 正确:
  • 错误:
  • 小区别,很难发现哦!
  • 问题解决方案:
  • 正确的文件结构应该如下所示:
  • 错误的文件结构示例:
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档