java.lang.NoClassDefFoundError: org/springframework/boot/bind/RelaxedDataBinder
问题描述:springcloudEureka启动类启动时有如下报错这个问题查过很多资料,都说是在主模块添加<parent><artifactId>org.springframework.boot</artifactId><groupId>spring-boot-starter-parent</groupId><version>
·
问题描述:
springcloud Eureka启动类启动时有如下报错
这个问题查过很多资料,都说是在主模块添加,这个是由于springcloud版本与springboot版本不对应导致的,因为我的SpringCloud版本是D版本,只能对应springboot 1.5*版本
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Dalston.SR1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
而我的springboot的版本是2.*版本,两者有枪对应关系
可以参考这篇文章查看具体版本对应关系SpringBoot与SpringCloud的版本对应详细版,如有链接失效请告知!
<parent>
<artifactId>org.springframework.boot</artifactId>
<groupId>spring-boot-starter-parent</groupId>
<version>2.2.2.RELEASE</version>
</parent>
但是这个好像对我不适用,我有如下操作就可以了,希望可以帮到你!
11:08:26.264 [main] DEBUG org.springframework.boot.context.logging.ClasspathLoggingApplicationListener - Application failed to start with classpath: [file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/charsets.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/deploy.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/ext/access-bridge-64.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/ext/cldrdata.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/ext/dnsns.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/ext/jaccess.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/ext/jfxrt.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/ext/localedata.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/ext/nashorn.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/ext/sunec.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/ext/sunjce_provider.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/ext/sunmscapi.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/ext/sunpkcs11.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/ext/zipfs.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/javaws.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/jce.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/jfr.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/jfxswt.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/jsse.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/management-agent.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/plugin.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/resources.jar, file:/D:/app_tools/Java/jdk1.8.0_321/jre/lib/rt.jar, file:/D:/work/idea_workspace/microservicecloud/microservicecloud-eureka-7001/target/classes/, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/cloud/spring-cloud-netflix-eureka-server/1.3.6.RELEASE/spring-cloud-netflix-eureka-server-1.3.6.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/boot/spring-boot-starter-web/2.2.13.RELEASE/spring-boot-starter-web-2.2.13.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/boot/spring-boot-starter/2.2.13.RELEASE/spring-boot-starter-2.2.13.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/boot/spring-boot-starter-logging/2.2.13.RELEASE/spring-boot-starter-logging-2.2.13.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/ch/qos/logback/logback-core/1.2.10/logback-core-1.2.10.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/apache/logging/log4j/log4j-to-slf4j/2.12.1/log4j-to-slf4j-2.12.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/apache/logging/log4j/log4j-api/2.12.1/log4j-api-2.12.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/slf4j/jul-to-slf4j/1.7.30/jul-to-slf4j-1.7.30.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/spring-core/5.2.12.RELEASE/spring-core-5.2.12.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/spring-jcl/5.2.12.RELEASE/spring-jcl-5.2.12.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/yaml/snakeyaml/1.25/snakeyaml-1.25.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/boot/spring-boot-starter-json/2.2.13.RELEASE/spring-boot-starter-json-2.2.13.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.10.5/jackson-datatype-jdk8-2.10.5.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.10.5/jackson-datatype-jsr310-2.10.5.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.10.5/jackson-module-parameter-names-2.10.5.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/boot/spring-boot-starter-tomcat/2.2.13.RELEASE/spring-boot-starter-tomcat-2.2.13.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.41/tomcat-embed-core-9.0.41.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/apache/tomcat/embed/tomcat-embed-el/9.0.41/tomcat-embed-el-9.0.41.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.41/tomcat-embed-websocket-9.0.41.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/boot/spring-boot-starter-validation/2.2.13.RELEASE/spring-boot-starter-validation-2.2.13.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/jakarta/validation/jakarta.validation-api/2.0.2/jakarta.validation-api-2.0.2.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/hibernate/validator/hibernate-validator/6.0.22.Final/hibernate-validator-6.0.22.Final.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/jboss/logging/jboss-logging/3.4.1.Final/jboss-logging-3.4.1.Final.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/fasterxml/classmate/1.5.1/classmate-1.5.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/spring-web/5.2.12.RELEASE/spring-web-5.2.12.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/spring-beans/5.2.12.RELEASE/spring-beans-5.2.12.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/spring-webmvc/5.2.12.RELEASE/spring-webmvc-5.2.12.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/spring-aop/5.2.12.RELEASE/spring-aop-5.2.12.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/spring-context/5.2.12.RELEASE/spring-context-5.2.12.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/spring-expression/5.2.12.RELEASE/spring-expression-5.2.12.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/boot/spring-boot-starter-actuator/2.2.13.RELEASE/spring-boot-starter-actuator-2.2.13.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/boot/spring-boot-actuator-autoconfigure/2.2.13.RELEASE/spring-boot-actuator-autoconfigure-2.2.13.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/boot/spring-boot-actuator/2.2.13.RELEASE/spring-boot-actuator-2.2.13.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/io/micrometer/micrometer-core/1.3.16/micrometer-core-1.3.16.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/hdrhistogram/HdrHistogram/2.1.11/HdrHistogram-2.1.11.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/latencyutils/LatencyUtils/2.0.3/LatencyUtils-2.0.3.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/boot/spring-boot-starter-freemarker/2.2.13.RELEASE/spring-boot-starter-freemarker-2.2.13.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/freemarker/freemarker/2.3.30/freemarker-2.3.30.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/spring-context-support/5.2.12.RELEASE/spring-context-support-5.2.12.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/cloud/spring-cloud-commons/1.2.5.RELEASE/spring-cloud-commons-1.2.5.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/security/spring-security-crypto/5.2.8.RELEASE/spring-security-crypto-5.2.8.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/cloud/spring-cloud-netflix-core/1.3.6.RELEASE/spring-cloud-netflix-core-1.3.6.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/boot/spring-boot/2.2.13.RELEASE/spring-boot-2.2.13.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/boot/spring-boot-autoconfigure/2.2.13.RELEASE/spring-boot-autoconfigure-2.2.13.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/cloud/spring-cloud-netflix-eureka-client/1.3.6.RELEASE/spring-cloud-netflix-eureka-client-1.3.6.RELEASE.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/netflix/eureka/eureka-client/1.6.2/eureka-client-1.6.2.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/codehaus/jettison/jettison/1.3.7/jettison-1.3.7.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/netflix/netflix-commons/netflix-eventbus/0.3.0/netflix-eventbus-0.3.0.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/netflix/netflix-commons/netflix-infix/0.3.0/netflix-infix-0.3.0.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/joda-time/joda-time/2.10.9/joda-time-2.10.9.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/antlr/antlr-runtime/3.4/antlr-runtime-3.4.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/antlr/stringtemplate/3.2.1/stringtemplate-3.2.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/antlr/antlr/2.7.7/antlr-2.7.7.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/apache/commons/commons-math/2.2/commons-math-2.2.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/netflix/servo/servo-core/0.10.1/servo-core-0.10.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/netflix/servo/servo-internal/0.10.1/servo-internal-0.10.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/sun/jersey/jersey-core/1.19.1/jersey-core-1.19.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/sun/jersey/jersey-client/1.19.1/jersey-client-1.19.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/sun/jersey/contribs/jersey-apache-client4/1.19.1/jersey-apache-client4-1.19.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/apache/httpcomponents/httpcore/4.4.14/httpcore-4.4.14.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/commons-codec/commons-codec/1.13/commons-codec-1.13.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/google/inject/guice/4.1.0/guice-4.1.0.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/fasterxml/jackson/core/jackson-annotations/2.10.5/jackson-annotations-2.10.5.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/fasterxml/jackson/core/jackson-core/2.10.5/jackson-core-2.10.5.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/fasterxml/jackson/core/jackson-databind/2.10.5.1/jackson-databind-2.10.5.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/sun/jersey/jersey-servlet/1.19.1/jersey-servlet-1.19.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/sun/jersey/jersey-server/1.19.1/jersey-server-1.19.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/netflix/eureka/eureka-core/1.6.2/eureka-core-1.6.2.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/codehaus/woodstox/woodstox-core-asl/4.4.1/woodstox-core-asl-4.4.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/netflix/archaius/archaius-core/0.7.4/archaius-core-0.7.4.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/commons-configuration/commons-configuration/1.8/commons-configuration-1.8.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/google/guava/guava/18.0/guava-18.0.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/javax/inject/javax.inject/1/javax.inject-1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/fasterxml/jackson/dataformat/jackson-dataformat-xml/2.10.5/jackson-dataformat-xml-2.10.5.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.10.5/jackson-module-jaxb-annotations-2.10.5.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/jakarta/xml/bind/jakarta.xml.bind-api/2.3.3/jakarta.xml.bind-api-2.3.3.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/jakarta/activation/jakarta.activation-api/1.2.2/jakarta.activation-api-1.2.2.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/codehaus/woodstox/stax2-api/4.2.1/stax2-api-4.2.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/fasterxml/woodstox/woodstox-core/6.2.1/woodstox-core-6.2.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/com/thoughtworks/xstream/xstream/1.4.9/xstream-1.4.9.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar, file:/D:/app_tools/work_tools/apache-maven-3.8.4/maven_repository/org/springframework/springloaded/1.2.7.RELEASE/springloaded-1.2.7.RELEASE.jar, file:/D:/app_tools/work_tools/IntelliJ%20IDEA%202019.2.4/lib/idea_rt.jar]
11:08:26.278 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.NoClassDefFoundError: org/springframework/boot/bind/RelaxedDataBinder
at org.springframework.cloud.client.HostInfoEnvironmentPostProcessor.getFirstNonLoopbackHostInfo(HostInfoEnvironmentPostProcessor.java:45)
at org.springframework.cloud.client.HostInfoEnvironmentPostProcessor.postProcessEnvironment(HostInfoEnvironmentPostProcessor.java:34)
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:189)
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:177)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:76)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:53)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:345)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at com.atguigu.springcloud.EurekaServer7001_App.main(EurekaServer7001_App.java:11)
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.bind.RelaxedDataBinder
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 15 common frames omitted
Process finished with exit code 1
解决问题:
eureka属于子模块,在主模块的pom.xml中有如下配置
修改前:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.2.2.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
修改后:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.5.9.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
启动eureka问题解决!OVER
更多推荐
已为社区贡献2条内容
所有评论(0)