赞
踩
在创建springcloud项目的时候,使用Eurake注册中心的时候,一直都是版本不对应的问题,
问题:
- "D:\Program Files\Java\jdk1.8.0_241\bin\java.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:\idea\IntelliJ IDEA 2020.2.3\lib\idea_rt.jar=62179:D:\idea\IntelliJ IDEA 2020.2.3\bin" -Dfile.encoding=UTF-8 -classpath "D:\Program Files\Java\jdk1.8.0_241\jre\lib\charsets.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\deploy.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\ext\access-bridge-64.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\ext\cldrdata.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\ext\dnsns.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\ext\jaccess.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\ext\jfxrt.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\ext\localedata.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\ext\nashorn.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\ext\sunec.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\ext\sunjce_provider.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\ext\sunmscapi.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\ext\sunpkcs11.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\ext\zipfs.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\javaws.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\jce.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\jfr.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\jfxswt.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\jsse.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\management-agent.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\plugin.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\resources.jar;D:\Program Files\Java\jdk1.8.0_241\jre\lib\rt.jar;D:\java3\2021\2021NextSemester\springboot cloud\springboot-eurake-cs\target\classes;D:\Program Files\repository\org\springframework\boot\spring-boot-starter\2.5.5\spring-boot-starter-2.5.5.jar;D:\Program Files\repository\org\springframework\boot\spring-boot\2.5.5\spring-boot-2.5.5.jar;D:\Program Files\repository\org\springframework\spring-context\5.3.10\spring-context-5.3.10.jar;D:\Program Files\repository\org\springframework\spring-aop\5.3.10\spring-aop-5.3.10.jar;D:\Program Files\repository\org\springframework\spring-beans\5.3.10\spring-beans-5.3.10.jar;D:\Program Files\repository\org\springframework\spring-expression\5.3.10\spring-expression-5.3.10.jar;D:\Program Files\repository\org\springframework\boot\spring-boot-autoconfigure\2.5.5\spring-boot-autoconfigure-2.5.5.jar;D:\Program Files\repository\org\springframework\boot\spring-boot-starter-logging\2.5.5\spring-boot-starter-logging-2.5.5.jar;D:\Program Files\repository\ch\qos\logback\logback-classic\1.2.6\logback-classic-1.2.6.jar;D:\Program Files\repository\ch\qos\logback\logback-core\1.2.6\logback-core-1.2.6.jar;D:\Program Files\repository\org\apache\logging\log4j\log4j-to-slf4j\2.14.1\log4j-to-slf4j-2.14.1.jar;D:\Program Files\repository\org\apache\logging\log4j\log4j-api\2.14.1\log4j-api-2.14.1.jar;D:\Program Files\repository\org\slf4j\jul-to-slf4j\1.7.32\jul-to-slf4j-1.7.32.jar;D:\Program Files\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;D:\Program Files\repository\org\springframework\spring-core\5.3.10\spring-core-5.3.10.jar;D:\Program Files\repository\org\springframework\spring-jcl\5.3.10\spring-jcl-5.3.10.jar;D:\Program Files\repository\org\yaml\snakeyaml\1.28\snakeyaml-1.28.jar;D:\Program Files\repository\org\slf4j\slf4j-api\1.7.32\slf4j-api-1.7.32.jar;D:\Program Files\repository\jakarta\xml\bind\jakarta.xml.bind-api\2.3.3\jakarta.xml.bind-api-2.3.3.jar;D:\Program Files\repository\jakarta\activation\jakarta.activation-api\1.2.2\jakarta.activation-api-1.2.2.jar;D:\Program Files\repository\org\springframework\cloud\spring-cloud-starter-eureka-server\1.4.4.RELEASE\spring-cloud-starter-eureka-server-1.4.4.RELEASE.jar;D:\Program Files\repository\org\springframework\cloud\spring-cloud-starter-netflix-eureka-server\1.4.4.RELEASE\spring-cloud-starter-netflix-eureka-server-1.4.4.RELEASE.jar;D:\Program Files\repository\org\springframework\cloud\spring-cloud-starter\1.3.3.RELEASE\spring-cloud-starter-1.3.3.RELEASE.jar;D:\Program Files\repository\org\springframework\cloud\spring-cloud-context\1.3.3.RELEASE\spring-cloud-context-1.3.3.RELEASE.jar;D:\Program Files\repository\org\springframework\security\spring-security-crypto\5.5.2\spring-security-crypto-5.5.2.jar;D:\Program Files\repository\org\springframework\cloud\spring-cloud-commons\1.3.3.RELEASE\spring-cloud-commons-1.3.3.RELEASE.jar;D:\Program Files\repository\org\apache\httpcomponents\httpclient\4.5.13\httpclient-4.5.13.jar;D:\Program Files\repository\org\apache\httpcomponents\httpcore\4.4.14\httpcore-4.4.14.jar;D:\Program Files\repository\commons-codec\commons-codec\1.15\commons-codec-1.15.jar;D:\Program Files\repository\org\springframework\security\spring-security-rsa\1.0.3.RELEASE\spring-security-rsa-1.0.3.RELEASE.jar;D:\Program Files\repository\org\bouncycastle\bcpkix-jdk15on\1.55\bcpkix-jdk15on-1.55.jar;D:\Program Files\repository\org\bouncycastle\bcprov-jdk15on\1.55\bcprov-jdk15on-1.55.jar;D:\Program Files\repository\org\springframework\cloud\spring-cloud-netflix-eureka-server\1.4.4.RELEASE\spring-cloud-netflix-eureka-server-1.4.4.RELEASE.jar;D:\Program Files\repository\org\springframework\boot\spring-boot-starter-web\2.5.5\spring-boot-starter-web-2.5.5.jar;D:\Program Files\repository\org\springframework\boot\spring-boot-starter-json\2.5.5\spring-boot-starter-json-2.5.5.jar;D:\Program Files\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.12.5\jackson-datatype-jdk8-2.12.5.jar;D:\Program Files\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.12.5\jackson-datatype-jsr310-2.12.5.jar;D:\Program Files\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.12.5\jackson-module-parameter-names-2.12.5.jar;D:\Program Files\repository\org\springframework\boot\spring-boot-starter-tomcat\2.5.5\spring-boot-starter-tomcat-2.5.5.jar;D:\Program Files\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.53\tomcat-embed-core-9.0.53.jar;D:\Program Files\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.53\tomcat-embed-el-9.0.53.jar;D:\Program Files\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.53\tomcat-embed-websocket-9.0.53.jar;D:\Program Files\repository\org\springframework\spring-web\5.3.10\spring-web-5.3.10.jar;D:\Program Files\repository\org\springframework\spring-webmvc\5.3.10\spring-webmvc-5.3.10.jar;D:\Program Files\repository\org\springframework\boot\spring-boot-starter-actuator\2.5.5\spring-boot-starter-actuator-2.5.5.jar;D:\Program Files\repository\org\springframework\boot\spring-boot-actuator-autoconfigure\2.5.5\spring-boot-actuator-autoconfigure-2.5.5.jar;D:\Program Files\repository\org\springframework\boot\spring-boot-actuator\2.5.5\spring-boot-actuator-2.5.5.jar;D:\Program Files\repository\io\micrometer\micrometer-core\1.7.4\micrometer-core-1.7.4.jar;D:\Program Files\repository\org\hdrhistogram\HdrHistogram\2.1.12\HdrHistogram-2.1.12.jar;D:\Program Files\repository\org\latencyutils\LatencyUtils\2.0.3\LatencyUtils-2.0.3.jar;D:\Program Files\repository\org\springframework\boot\spring-boot-starter-freemarker\2.5.5\spring-boot-starter-freemarker-2.5.5.jar;D:\Program Files\repository\org\freemarker\freemarker\2.3.31\freemarker-2.3.31.jar;D:\Program Files\repository\org\springframework\spring-context-support\5.3.10\spring-context-support-5.3.10.jar;D:\Program Files\repository\org\springframework\cloud\spring-cloud-netflix-core\1.4.4.RELEASE\spring-cloud-netflix-core-1.4.4.RELEASE.jar;D:\Program Files\repository\org\springframework\cloud\spring-cloud-netflix-eureka-client\1.4.4.RELEASE\spring-cloud-netflix-eureka-client-1.4.4.RELEASE.jar;D:\Program Files\repository\com\netflix\eureka\eureka-client\1.7.2\eureka-client-1.7.2.jar;D:\Program Files\repository\org\codehaus\jettison\jettison\1.3.7\jettison-1.3.7.jar;D:\Program Files\repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar;D:\Program Files\repository\com\netflix\netflix-commons\netflix-eventbus\0.3.0\netflix-eventbus-0.3.0.jar;D:\Program Files\repository\com\netflix\netflix-commons\netflix-infix\0.3.0\netflix-infix-0.3.0.jar;D:\Program Files\repository\commons-jxpath\commons-jxpath\1.3\commons-jxpath-1.3.jar;D:\Program Files\repository\org\antlr\antlr-runtime\3.4\antlr-runtime-3.4.jar;D:\Program Files\repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.jar;D:\Program Files\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar;D:\Program Files\repository\com\google\code\gson\gson\2.8.8\gson-2.8.8.jar;D:\Program Files\repository\org\apache\commons\commons-math\2.2\commons-math-2.2.jar;D:\Program Files\repository\javax\ws\rs\jsr311-api\1.1.1\jsr311-api-1.1.1.jar;D:\Program Files\repository\com\netflix\servo\servo-core\0.10.1\servo-core-0.10.1.jar;D:\Program Files\repository\com\netflix\servo\servo-internal\0.10.1\servo-internal-0.10.1.jar;D:\Program Files\repository\com\sun\jersey\jersey-core\1.19.1\jersey-core-1.19.1.jar;D:\Program Files\repository\com\sun\jersey\jersey-client\1.19.1\jersey-client-1.19.1.jar;D:\Program Files\repository\com\sun\jersey\contribs\jersey-apache-client4\1.19.1\jersey-apache-client4-1.19.1.jar;D:\Program Files\repository\com\google\inject\guice\4.1.0\guice-4.1.0.jar;D:\Program Files\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;D:\Program Files\repository\com\sun\jersey\jersey-servlet\1.19.1\jersey-servlet-1.19.1.jar;D:\Program Files\repository\com\sun\jersey\jersey-server\1.19.1\jersey-server-1.19.1.jar;D:\Program Files\repository\com\netflix\eureka\eureka-core\1.7.2\eureka-core-1.7.2.jar;D:\Program Files\repository\com\amazonaws\aws-java-sdk-core\1.11.105\aws-java-sdk-core-1.11.105.jar;D:\Program Files\repository\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar;D:\Program Files\repository\software\amazon\ion\ion-java\1.0.2\ion-java-1.0.2.jar;D:\Program Files\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-cbor\2.12.5\jackson-dataformat-cbor-2.12.5.jar;D:\Program Files\repository\joda-time\joda-time\2.8.1\joda-time-2.8.1.jar;D:\Program Files\repository\com\amazonaws\aws-java-sdk-ec2\1.11.105\aws-java-sdk-ec2-1.11.105.jar;D:\Program Files\repository\com\amazonaws\jmespath-java\1.11.105\jmespath-java-1.11.105.jar;D:\Program Files\repository\com\amazonaws\aws-java-sdk-autoscaling\1.11.105\aws-java-sdk-autoscaling-1.11.105.jar;D:\Program Files\repository\com\amazonaws\aws-java-sdk-sts\1.11.105\aws-java-sdk-sts-1.11.105.jar;D:\Program Files\repository\com\amazonaws\aws-java-sdk-route53\1.11.105\aws-java-sdk-route53-1.11.105.jar;D:\Program Files\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar;D:\Program Files\repository\org\codehaus\woodstox\woodstox-core-asl\4.4.1\woodstox-core-asl-4.4.1.jar;D:\Program Files\repository\javax\xml\stream\stax-api\1.0-2\stax-api-1.0-2.jar;D:\Program Files\repository\com\netflix\archaius\archaius-core\0.7.4\archaius-core-0.7.4.jar;D:\Program Files\repository\com\google\code\findbugs\jsr305\3.0.1\jsr305-3.0.1.jar;D:\Program Files\repository\javax\inject\javax.inject\1\javax.inject-1.jar;D:\Program Files\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-xml\2.12.5\jackson-dataformat-xml-2.12.5.jar;D:\Program Files\repository\com\fasterxml\jackson\module\jackson-module-jaxb-annotations\2.12.5\jackson-module-jaxb-annotations-2.12.5.jar;D:\Program Files\repository\org\codehaus\woodstox\stax2-api\4.2.1\stax2-api-4.2.1.jar;D:\Program Files\repository\com\fasterxml\woodstox\woodstox-core\6.2.4\woodstox-core-6.2.4.jar;D:\Program Files\repository\com\thoughtworks\xstream\xstream\1.4.10\xstream-1.4.10.jar;D:\Program Files\repository\xmlpull\xmlpull\1.1.3.1\xmlpull-1.1.3.1.jar;D:\Program Files\repository\xpp3\xpp3_min\1.1.4c\xpp3_min-1.1.4c.jar;D:\Program Files\repository\org\springframework\cloud\spring-cloud-starter-netflix-archaius\1.4.4.RELEASE\spring-cloud-starter-netflix-archaius-1.4.4.RELEASE.jar;D:\Program Files\repository\commons-configuration\commons-configuration\1.8\commons-configuration-1.8.jar;D:\Program Files\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;D:\Program Files\repository\com\fasterxml\jackson\core\jackson-annotations\2.12.5\jackson-annotations-2.12.5.jar;D:\Program Files\repository\com\fasterxml\jackson\core\jackson-core\2.12.5\jackson-core-2.12.5.jar;D:\Program Files\repository\com\fasterxml\jackson\core\jackson-databind\2.12.5\jackson-databind-2.12.5.jar;D:\Program Files\repository\com\google\guava\guava\18.0\guava-18.0.jar;D:\Program Files\repository\org\springframework\cloud\spring-cloud-starter-netflix-ribbon\1.4.4.RELEASE\spring-cloud-starter-netflix-ribbon-1.4.4.RELEASE.jar;D:\Program Files\repository\com\netflix\ribbon\ribbon\2.2.5\ribbon-2.2.5.jar;D:\Program Files\repository\com\netflix\ribbon\ribbon-transport\2.2.5\ribbon-transport-2.2.5.jar;D:\Program Files\repository\io\reactivex\rxnetty-contexts\0.4.9\rxnetty-contexts-0.4.9.jar;D:\Program Files\repository\io\reactivex\rxnetty-servo\0.4.9\rxnetty-servo-0.4.9.jar;D:\Program Files\repository\com\netflix\hystrix\hystrix-core\1.4.3\hystrix-core-1.4.3.jar;D:\Program Files\repository\io\reactivex\rxnetty\0.4.9\rxnetty-0.4.9.jar;D:\Program Files\repository\io\netty\netty-codec-http\4.1.68.Final\netty-codec-http-4.1.68.Final.jar;D:\Program Files\repository\io\netty\netty-common\4.1.68.Final\netty-common-4.1.68.Final.jar;D:\Program Files\repository\io\netty\netty-buffer\4.1.68.Final\netty-buffer-4.1.68.Final.jar;D:\Program Files\repository\io\netty\netty-transport\4.1.68.Final\netty-transport-4.1.68.Final.jar;D:\Program Files\repository\io\netty\netty-resolver\4.1.68.Final\netty-resolver-4.1.68.Final.jar;D:\Program Files\repository\io\netty\netty-codec\4.1.68.Final\netty-codec-4.1.68.Final.jar;D:\Program Files\repository\io\netty\netty-handler\4.1.68.Final\netty-handler-4.1.68.Final.jar;D:\Program Files\repository\io\netty\netty-transport-native-epoll\4.1.68.Final\netty-transport-native-epoll-4.1.68.Final.jar;D:\Program Files\repository\io\netty\netty-transport-native-unix-common\4.1.68.Final\netty-transport-native-unix-common-4.1.68.Final.jar;D:\Program Files\repository\com\netflix\ribbon\ribbon-core\2.2.5\ribbon-core-2.2.5.jar;D:\Program Files\repository\com\netflix\ribbon\ribbon-httpclient\2.2.5\ribbon-httpclient-2.2.5.jar;D:\Program Files\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;D:\Program Files\repository\com\netflix\netflix-commons\netflix-commons-util\0.1.1\netflix-commons-util-0.1.1.jar;D:\Program Files\repository\com\netflix\ribbon\ribbon-loadbalancer\2.2.5\ribbon-loadbalancer-2.2.5.jar;D:\Program Files\repository\com\netflix\netflix-commons\netflix-statistics\0.1.1\netflix-statistics-0.1.1.jar;D:\Program Files\repository\io\reactivex\rxjava\1.3.8\rxjava-1.3.8.jar;D:\Program Files\repository\com\netflix\ribbon\ribbon-eureka\2.2.5\ribbon-eureka-2.2.5.jar" com.nsw.SpringbootEurakeCsApplication
- 15:04:15.245 [main] DEBUG org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter - Application failed to start due to an exception
- java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V
- at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:161)
- at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:102)
- at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:68)
- 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:82)
- at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63)
- at java.util.ArrayList.forEach(ArrayList.java:1257)
- at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
- at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
- at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)
- at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:374)
- at org.springframework.boot.SpringApplication.run(SpringApplication.java:332)
- at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343)
- at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332)
- at com.nsw.SpringbootEurakeCsApplication.main(SpringbootEurakeCsApplication.java:12)
- 15:04:15.250 [main] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter -
在网上搜索问题之后,发现是版本不对应,在搜索springcloud与Eurake版本对应的时候,发现,
- <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-eureka-server -->
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-eureka-server</artifactId>
- <version>1.4.4.RELEASE</version>
- </dependency>
引用的1.4.4版本,与最近的springcloud版本不对应,在看到这篇文章的时候https://blog.csdn.net/weixin_39589923/article/details/111690239
才发现,eureke已经版本换过了,如果你是用比较新的springcloud版本,请搜索
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
- <version>3.0.4</version>
- </dependency>
这个eureka版本!
最后加上我是用的springboot和springcloud版本
- <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies -->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-dependencies</artifactId>
- <version>2.3.8.RELEASE</version>
- <type>pom</type>
- <scope>provided</scope>
- </dependency>
- <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies -->
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-dependencies</artifactId>
- <version>Hoxton.SR12</version>
- <type>pom</type>
- <scope>runtime</scope>
- </dependency>
小白一位,侵权私信!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。