java.lang.NoClassDefFoundError: org/springframework/boot/Bootstrapper 异常解决「建议收藏」

2022-09-09 14:33:38 浏览数 (1)

大家好,又见面了,我是你们的朋友全栈君。

异常描述

代码语言:javascript复制
/*
* 提示:该行代码过长,系统自动注释不进行高亮。一键复制会移除系统注释 
* "C:Program FilesJavajdk1.8.0_131binjava.exe" -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:D:softDevIntelliJ IDEA 2019.3.2libidea_rt.jar=61202:D:softDevIntelliJ IDEA 2019.3.2bin" -Dfile.encoding=UTF-8 -classpath "C:Program FilesJavajdk1.8.0_131jrelibcharsets.jar;C:Program FilesJavajdk1.8.0_131jrelibdeploy.jar;C:Program FilesJavajdk1.8.0_131jrelibextaccess-bridge-64.jar;C:Program FilesJavajdk1.8.0_131jrelibextcldrdata.jar;C:Program FilesJavajdk1.8.0_131jrelibextdnsns.jar;C:Program FilesJavajdk1.8.0_131jrelibextjaccess.jar;C:Program FilesJavajdk1.8.0_131jrelibextjfxrt.jar;C:Program FilesJavajdk1.8.0_131jrelibextlocaledata.jar;C:Program FilesJavajdk1.8.0_131jrelibextnashorn.jar;C:Program FilesJavajdk1.8.0_131jrelibextsunec.jar;C:Program FilesJavajdk1.8.0_131jrelibextsunjce_provider.jar;C:Program FilesJavajdk1.8.0_131jrelibextsunmscapi.jar;C:Program FilesJavajdk1.8.0_131jrelibextsunpkcs11.jar;C:Program FilesJavajdk1.8.0_131jrelibextzipfs.jar;C:Program FilesJavajdk1.8.0_131jrelibjavaws.jar;C:Program FilesJavajdk1.8.0_131jrelibjce.jar;C:Program FilesJavajdk1.8.0_131jrelibjfr.jar;C:Program FilesJavajdk1.8.0_131jrelibjfxswt.jar;C:Program FilesJavajdk1.8.0_131jrelibjsse.jar;C:Program FilesJavajdk1.8.0_131jrelibmanagement-agent.jar;C:Program FilesJavajdk1.8.0_131jrelibplugin.jar;C:Program FilesJavajdk1.8.0_131jrelibresources.jar;C:Program FilesJavajdk1.8.0_131jrelibrt.jar;E:project-demoJava-demoproject-managementproject-parentproject-systemtargetclasses;D:apachemavenrepositoryorgspringframeworkbootspring-boot-starter-web2.6.6spring-boot-starter-web-2.6.6.jar;D:apachemavenrepositoryorgspringframeworkbootspring-boot-starter2.6.6spring-boot-starter-2.6.6.jar;D:apachemavenrepositoryorgspringframeworkbootspring-boot2.6.6spring-boot-2.6.6.jar;D:apachemavenrepositoryorgspringframeworkbootspring-boot-autoconfigure2.6.6spring-boot-autoconfigure-2.6.6.jar;D:apachemavenrepositoryorgspringframeworkbootspring-boot-starter-logging2.6.6spring-boot-starter-logging-2.6.6.jar;D:apachemavenrepositorychqoslogbacklogback-classic1.2.11logback-classic-1.2.11.jar;D:apachemavenrepositorychqoslogbacklogback-core1.2.11logback-core-1.2.11.jar;D:apachemavenrepositoryorgapachelogginglog4jlog4j-to-slf4j2.17.2log4j-to-slf4j-2.17.2.jar;D:apachemavenrepositoryorgapachelogginglog4jlog4j-api2.17.2log4j-api-2.17.2.jar;D:apachemavenrepositoryorgslf4jjul-to-slf4j1.7.36jul-to-slf4j-1.7.36.jar;D:apachemavenrepositoryjakartaannotationjakarta.annotation-api1.3.5jakarta.annotation-api-1.3.5.jar;D:apachemavenrepositoryorgyamlsnakeyaml1.29snakeyaml-1.29.jar;D:apachemavenrepositoryorgspringframeworkbootspring-boot-starter-json2.6.6spring-boot-starter-json-2.6.6.jar;D:apachemavenrepositorycomfasterxmljacksoncorejackson-databind2.13.2.2jackson-databind-2.13.2.2.jar;D:apachemavenrepositorycomfasterxmljacksoncorejackson-annotations2.13.2jackson-annotations-2.13.2.jar;D:apachemavenrepositorycomfasterxmljacksondatatypejackson-datatype-jdk82.13.2jackson-datatype-jdk8-2.13.2.jar;D:apachemavenrepositorycomfasterxmljacksondatatypejackson-datatype-jsr3102.13.2jackson-datatype-jsr310-2.13.2.jar;D:apachemavenrepositorycomfasterxmljacksonmodulejackson-module-parameter-names2.13.2jackson-module-parameter-names-2.13.2.jar;D:apachemavenrepositoryorgspringframeworkbootspring-boot-starter-tomcat2.6.6spring-boot-starter-tomcat-2.6.6.jar;D:apachemavenrepositoryorgapachetomcatembedtomcat-embed-core9.0.60tomcat-embed-core-9.0.60.jar;D:apachemavenrepositoryorgapachetomcatembedtomcat-embed-el9.0.60tomcat-embed-el-9.0.60.jar;D:apachemavenrepositoryorgapachetomcatembedtomcat-embed-websocket9.0.60tomcat-embed-websocket-9.0.60.jar;D:apachemavenrepositoryorgspringframeworkspring-web5.3.18spring-web-5.3.18.jar;D:apachemavenrepositoryorgspringframeworkspring-beans5.3.18spring-beans-5.3.18.jar;D:apachemavenrepositoryorgspringframeworkspring-webmvc5.3.18spring-webmvc-5.3.18.jar;D:apachemavenrepositoryorgspringframeworkspring-context5.3.18spring-context-5.3.18.jar;D:apachemavenrepositoryorgspringframeworkspring-expression5.3.18spring-expression-5.3.18.jar;D:apachemavenrepositoryorgspringframeworkbootspring-boot-starter-test2.6.6spring-boot-starter-test-2.6.6.jar;D:apachemavenrepositoryorgspringframeworkbootspring-boot-test2.6.6spring-boot-test-2.6.6.jar;D:apachemavenrepositoryorgspringframeworkbootspring-boot-test-autoconfigure2.6.6spring-boot-test-autoconfigure-2.6.6.jar;D:apachemavenrepositorycomjaywayjsonpathjson-path2.6.0json-path-2.6.0.jar;D:apachemavenrepositorynetminidevjson-smart2.4.8json-smart-2.4.8.jar;D:apachemavenrepositorynetminidevaccessors-smart2.4.8accessors-smart-2.4.8.jar;D:apachemavenrepositoryorgow2asmasm9.1asm-9.1.jar;D:apachemavenrepositoryorgslf4jslf4j-api1.7.36slf4j-api-1.7.36.jar;D:apachemavenrepositoryjakartaxmlbindjakarta.xml.bind-api2.3.3jakarta.xml.bind-api-2.3.3.jar;D:apachemavenrepositoryjakartaactivationjakarta.activation-api1.2.2jakarta.activation-api-1.2.2.jar;D:apachemavenrepositoryorgassertjassertj-core3.21.0assertj-core-3.21.0.jar;D:apachemavenrepositoryorghamcresthamcrest2.2hamcrest-2.2.jar;D:apachemavenrepositoryorgjunitjupiterjunit-jupiter5.8.2junit-jupiter-5.8.2.jar;D:apachemavenrepositoryorgjunitjupiterjunit-jupiter-api5.8.2junit-jupiter-api-5.8.2.jar;D:apachemavenrepositoryorgopentest4jopentest4j1.2.0opentest4j-1.2.0.jar;D:apachemavenrepositoryorgjunitplatformjunit-platform-commons1.8.2junit-platform-commons-1.8.2.jar;D:apachemavenrepositoryorgapiguardianapiguardian-api1.1.2apiguardian-api-1.1.2.jar;D:apachemavenrepositoryorgjunitjupiterjunit-jupiter-params5.8.2junit-jupiter-params-5.8.2.jar;D:apachemavenrepositoryorgjunitjupiterjunit-jupiter-engine5.8.2junit-jupiter-engine-5.8.2.jar;D:apachemavenrepositoryorgjunitplatformjunit-platform-engine1.8.2junit-platform-engine-1.8.2.jar;D:apachemavenrepositoryorgmockitomockito-core4.0.0mockito-core-4.0.0.jar;D:apachemavenrepositorynetbytebuddybyte-buddy1.11.22byte-buddy-1.11.22.jar;D:apachemavenrepositorynetbytebuddybyte-buddy-agent1.11.22byte-buddy-agent-1.11.22.jar;D:apachemavenrepositoryorgobjenesisobjenesis3.2objenesis-3.2.jar;D:apachemavenrepositoryorgmockitomockito-junit-jupiter4.0.0mockito-junit-jupiter-4.0.0.jar;D:apachemavenrepositoryorgskyscreamerjsonassert1.5.0jsonassert-1.5.0.jar;D:apachemavenrepositorycomvaadinexternalgoogleandroid-json.0.20131108.vaadin1android-json-0.0.20131108.vaadin1.jar;D:apachemavenrepositoryorgspringframeworkspring-core5.3.18spring-core-5.3.18.jar;D:apachemavenrepositoryorgspringframeworkspring-jcl5.3.18spring-jcl-5.3.18.jar;D:apachemavenrepositoryorgspringframeworkspring-test5.3.18spring-test-5.3.18.jar;D:apachemavenrepositoryorgxmlunitxmlunit-core2.8.4xmlunit-core-2.8.4.jar;D:apachemavenrepositoryorgspringframeworkbootspring-boot-starter-aop2.6.6spring-boot-starter-aop-2.6.6.jar;D:apachemavenrepositoryorgspringframeworkspring-aop5.3.18spring-aop-5.3.18.jar;D:apachemavenrepositoryorgaspectjaspectjweaver1.9.7aspectjweaver-1.9.7.jar;D:apachemavenrepositorycomalibabacloudspring-cloud-starter-alibaba-nacos-discovery2021.1spring-cloud-starter-alibaba-nacos-discovery-2021.1.jar;D:apachemavenrepositorycomalibabacloudspring-cloud-alibaba-commons2021.1spring-cloud-alibaba-commons-2021.1.jar;D:apachemavenrepositorycomalibabanacosnacos-client1.4.1nacos-client-1.4.1.jar;D:apachemavenrepositorycomalibabanacosnacos-common1.4.1nacos-common-1.4.1.jar;D:apachemavenrepositorycommons-iocommons-io2.2commons-io-2.2.jar;D:apachemavenrepositoryorgapachehttpcomponentshttpasyncclient4.1.5httpasyncclient-4.1.5.jar;D:apachemavenrepositoryorgapachehttpcomponentshttpcore4.4.15httpcore-4.4.15.jar;D:apachemavenrepositoryorgapachehttpcomponentshttpcore-nio4.4.15httpcore-nio-4.4.15.jar;D:apachemavenrepositoryorgapachehttpcomponentshttpclient4.5.13httpclient-4.5.13.jar;D:apachemavenrepositorycomalibabanacosnacos-api1.4.1nacos-api-1.4.1.jar;D:apachemavenrepositorycomgoogleguavaguava24.1.1-jreguava-24.1.1-jre.jar;D:apachemavenrepositorycomgooglecodefindbugsjsr3051.3.9jsr305-1.3.9.jar;D:apachemavenrepositoryorgcheckerframeworkchecker-compat-qual2.0.0checker-compat-qual-2.0.0.jar;D:apachemavenrepositorycomgoogleerrorproneerror_prone_annotations2.1.3error_prone_annotations-2.1.3.jar;D:apachemavenrepositorycomgooglej2objcj2objc-annotations1.1j2objc-annotations-1.1.jar;D:apachemavenrepositoryorgcodehausmojoanimal-sniffer-annotations1.14animal-sniffer-annotations-1.14.jar;D:apachemavenrepositorycommons-codeccommons-codec1.15commons-codec-1.15.jar;D:apachemavenrepositorycomfasterxmljacksoncorejackson-core2.13.2jackson-core-2.13.2.jar;D:apachemavenrepositoryioprometheussimpleclient.12.0simpleclient-0.12.0.jar;D:apachemavenrepositoryioprometheussimpleclient_tracer_otel.12.0simpleclient_tracer_otel-0.12.0.jar;D:apachemavenrepositoryioprometheussimpleclient_tracer_common.12.0simpleclient_tracer_common-0.12.0.jar;D:apachemavenrepositoryioprometheussimpleclient_tracer_otel_agent.12.0simpleclient_tracer_otel_agent-0.12.0.jar;D:apachemavenrepositorycomalibabaspringspring-context-support1.0.10spring-context-support-1.0.10.jar;D:apachemavenrepositoryorgspringframeworkcloudspring-cloud-commons3.0.1spring-cloud-commons-3.0.1.jar;D:apachemavenrepositoryorgspringframeworksecurityspring-security-crypto5.6.2spring-security-crypto-5.6.2.jar;D:apachemavenrepositoryorgspringframeworkcloudspring-cloud-context3.0.1spring-cloud-context-3.0.1.jar" com.xhs.SystemApp
*/
15:33:56.068 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.NoClassDefFoundError: org/springframework/boot/Bootstrapper
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.springframework.cloud.bootstrap.encrypt.DecryptEnvironmentPostProcessor.getTextEncryptor(DecryptEnvironmentPostProcessor.java:82)
	at org.springframework.cloud.bootstrap.encrypt.DecryptEnvironmentPostProcessor.postProcessEnvironment(DecryptEnvironmentPostProcessor.java:68)
	at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:102)
	at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:87)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
	at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85)
	at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66)
	at java.util.ArrayList.forEach(ArrayList.java:1249)
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120)
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114)
	at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65)
	at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:339)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:297)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
	at com.xhs.SystemApp.main(SystemApp.java:16)
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.Bootstrapper
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 31 common frames omitted

Process finished with exit code 1

异常分析:

Spring Boot 依赖版本和Spring Cloud Alibaba依赖版本不一致,导致报错。

异常解决:

将Spring Boot 依赖版本和Spring Cloud Alibaba依赖版本一一对应

序号

Spring Cloud Alibaba

Spring Cloud

Spring Boot

1

2.1.2.RELEASE

Greenwich

2.1.X.RELEASE

2

2.2.0.RELEASE

Hoxton.RELEASE

2.2.X.RELEASE

3

2.2.1.RELEASE

Hoxton.SR3

2.2.5.RELEASE

4

2.2.3.RELEASE

Hoxton.SR8

2.3.2.RELEASE

5

2.2.6.RELEASE

Hoxton.SR9

2.3.2.RELEASE

6

2021.1

2020.0.1

2.4.2

7

2.2.7.RELEASE

Hoxton.SR12

2.3.12.RELEASE

Spring Cloud Alibaba对应的Spring Boot 及Spring Cloud版本

https://github.com/alibaba/spring-cloud-alibaba/wiki/版本说明

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/162194.html原文链接:https://javaforall.cn

0 人点赞