springboot启动报错:ERROR org.springframework.boot.SpringApplication - Application run failed
问题:
用一个已经搭建好的springboot工程改造成eureka。
pom文件中springboot首先用的是2.0.6.RELEASE
springcloud用的Dalston.SR5
启动报如下错:
2:02:37.561 [main] DEBUG org.springframework.boot.context.logging.ClasspathLoggingApplicationListener - Application failed to start with classpath: [file:/D:/software/Java/jdk1.8.0_121/jre/lib/charsets.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/deploy.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/ext/access-bridge-32.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/ext/cldrdata.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/ext/dnsns.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/ext/jaccess.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/ext/jfxrt.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/ext/localedata.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/ext/nashorn.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/ext/sunec.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/ext/sunjce_provider.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/ext/sunmscapi.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/ext/sunpkcs11.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/ext/zipfs.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/javaws.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/jce.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/jfr.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/jfxswt.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/jsse.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/management-agent.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/plugin.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/resources.jar, file:/D:/software/Java/jdk1.8.0_121/jre/lib/rt.jar, file:/E:/code/study-euraka/target/classes/, file:/D:/jar/org/springframework/cloud/spring-cloud-starter-eureka-server/1.3.6.RELEASE/spring-cloud-starter-eureka-server-1.3.6.RELEASE.jar, file:/D:/jar/org/springframework/cloud/spring-cloud-starter/1.2.5.RELEASE/spring-cloud-starter-1.2.5.RELEASE.jar, file:/D:/jar/org/springframework/boot/spring-boot-starter/2.0.6.RELEASE/spring-boot-starter-2.0.6.RELEASE.jar, file:/D:/jar/org/springframework/boot/spring-boot/2.0.6.RELEASE/spring-boot-2.0.6.RELEASE.jar, file:/D:/jar/org/springframework/spring-context/5.0.10.RELEASE/spring-context-5.0.10.RELEASE.jar, file:/D:/jar/org/springframework/boot/spring-boot-autoconfigure/2.0.6.RELEASE/spring-boot-autoconfigure-2.0.6.RELEASE.jar, file:/D:/jar/org/springframework/boot/spring-boot-starter-logging/2.0.6.RELEASE/spring-boot-starter-logging-2.0.6.RELEASE.jar, file:/D:/jar/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar, file:/D:/jar/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar, file:/D:/jar/org/apache/logging/log4j/log4j-to-slf4j/2.10.0/log4j-to-slf4j-2.10.0.jar, file:/D:/jar/org/apache/logging/log4j/log4j-api/2.10.0/log4j-api-2.10.0.jar, file:/D:/jar/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar, file:/D:/jar/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar, file:/D:/jar/org/springframework/spring-core/5.0.10.RELEASE/spring-core-5.0.10.RELEASE.jar, file:/D:/jar/org/springframework/spring-jcl/5.0.10.RELEASE/spring-jcl-5.0.10.RELEASE.jar, file:/D:/jar/org/yaml/snakeyaml/1.19/snakeyaml-1.19.jar, file:/D:/jar/org/springframework/cloud/spring-cloud-context/1.2.5.RELEASE/spring-cloud-context-1.2.5.RELEASE.jar, file:/D:/jar/org/springframework/security/spring-security-crypto/5.0.9.RELEASE/spring-security-crypto-5.0.9.RELEASE.jar, file:/D:/jar/org/springframework/cloud/spring-cloud-commons/1.2.5.RELEASE/spring-cloud-commons-1.2.5.RELEASE.jar, file:/D:/jar/org/springframework/security/spring-security-rsa/1.0.3.RELEASE/spring-security-rsa-1.0.3.RELEASE.jar, file:/D:/jar/org/bouncycastle/bcpkix-jdk15on/1.55/bcpkix-jdk15on-1.55.jar, file:/D:/jar/org/bouncycastle/bcprov-jdk15on/1.55/bcprov-jdk15on-1.55.jar, file:/D:/jar/org/springframework/cloud/spring-cloud-netflix-eureka-server/1.3.6.RELEASE/spring-cloud-netflix-eureka-server-1.3.6.RELEASE.jar, file:/D:/jar/org/springframework/boot/spring-boot-starter-web/2.0.6.RELEASE/spring-boot-starter-web-2.0.6.RELEASE.jar, file:/D:/jar/org/springframework/boot/spring-boot-starter-json/2.0.6.RELEASE/spring-boot-starter-json-2.0.6.RELEASE.jar, file:/D:/jar/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.9.7/jackson-datatype-jdk8-2.9.7.jar, file:/D:/jar/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.9.7/jackson-datatype-jsr310-2.9.7.jar, file:/D:/jar/com/fasterxml/jackson/module/jackson-module-parameter-names/2.9.7/jackson-module-parameter-names-2.9.7.jar, file:/D:/jar/org/springframework/boot/spring-boot-starter-tomcat/2.0.6.RELEASE/spring-boot-starter-tomcat-2.0.6.RELEASE.jar, file:/D:/jar/org/apache/tomcat/embed/tomcat-embed-core/8.5.34/tomcat-embed-core-8.5.34.jar, file:/D:/jar/org/apache/tomcat/embed/tomcat-embed-el/8.5.34/tomcat-embed-el-8.5.34.jar, file:/D:/jar/org/apache/tomcat/embed/tomcat-embed-websocket/8.5.34/tomcat-embed-websocket-8.5.34.jar, file:/D:/jar/org/hibernate/validator/hibernate-validator/6.0.13.Final/hibernate-validator-6.0.13.Final.jar, file:/D:/jar/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar, file:/D:/jar/org/jboss/logging/jboss-logging/3.3.2.Final/jboss-logging-3.3.2.Final.jar, file:/D:/jar/com/fasterxml/classmate/1.3.4/classmate-1.3.4.jar, file:/D:/jar/org/springframework/spring-web/5.0.10.RELEASE/spring-web-5.0.10.RELEASE.jar, file:/D:/jar/org/springframework/spring-beans/5.0.10.RELEASE/spring-beans-5.0.10.RELEASE.jar, file:/D:/jar/org/springframework/spring-webmvc/5.0.10.RELEASE/spring-webmvc-5.0.10.RELEASE.jar, file:/D:/jar/org/springframework/spring-aop/5.0.10.RELEASE/spring-aop-5.0.10.RELEASE.jar, file:/D:/jar/org/springframework/spring-expression/5.0.10.RELEASE/spring-expression-5.0.10.RELEASE.jar, file:/D:/jar/org/springframework/boot/spring-boot-starter-actuator/2.0.6.RELEASE/spring-boot-starter-actuator-2.0.6.RELEASE.jar, file:/D:/jar/org/springframework/boot/spring-boot-actuator-autoconfigure/2.0.6.RELEASE/spring-boot-actuator-autoconfigure-2.0.6.RELEASE.jar, file:/D:/jar/org/springframework/boot/spring-boot-actuator/2.0.6.RELEASE/spring-boot-actuator-2.0.6.RELEASE.jar, file:/D:/jar/io/micrometer/micrometer-core/1.0.7/micrometer-core-1.0.7.jar, file:/D:/jar/org/hdrhistogram/HdrHistogram/2.1.10/HdrHistogram-2.1.10.jar, file:/D:/jar/org/latencyutils/LatencyUtils/2.0.3/LatencyUtils-2.0.3.jar, file:/D:/jar/org/springframework/boot/spring-boot-starter-freemarker/2.0.6.RELEASE/spring-boot-starter-freemarker-2.0.6.RELEASE.jar, file:/D:/jar/org/freemarker/freemarker/2.3.28/freemarker-2.3.28.jar, file:/D:/jar/org/springframework/spring-context-support/5.0.10.RELEASE/spring-context-support-5.0.10.RELEASE.jar, file:/D:/jar/org/springframework/cloud/spring-cloud-netflix-core/1.3.6.RELEASE/spring-cloud-netflix-core-1.3.6.RELEASE.jar, file:/D:/jar/org/springframework/cloud/spring-cloud-netflix-eureka-client/1.3.6.RELEASE/spring-cloud-netflix-eureka-client-1.3.6.RELEASE.jar, file:/D:/jar/com/netflix/eureka/eureka-client/1.6.2/eureka-client-1.6.2.jar, file:/D:/jar/org/codehaus/jettison/jettison/1.3.7/jettison-1.3.7.jar, file:/D:/jar/stax/stax-api/1.0.1/stax-api-1.0.1.jar, file:/D:/jar/com/netflix/netflix-commons/netflix-eventbus/0.3.0/netflix-eventbus-0.3.0.jar, file:/D:/jar/com/netflix/netflix-commons/netflix-infix/0.3.0/netflix-infix-0.3.0.jar, file:/D:/jar/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar, file:/D:/jar/joda-time/joda-time/2.9.9/joda-time-2.9.9.jar, file:/D:/jar/org/antlr/antlr-runtime/3.4/antlr-runtime-3.4.jar, file:/D:/jar/org/antlr/stringtemplate/3.2.1/stringtemplate-3.2.1.jar, file:/D:/jar/antlr/antlr/2.7.7/antlr-2.7.7.jar, file:/D:/jar/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar, file:/D:/jar/org/apache/commons/commons-math/2.2/commons-math-2.2.jar, file:/D:/jar/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar, file:/D:/jar/com/netflix/servo/servo-core/0.10.1/servo-core-0.10.1.jar, file:/D:/jar/com/netflix/servo/servo-internal/0.10.1/servo-internal-0.10.1.jar, file:/D:/jar/com/sun/jersey/jersey-core/1.19.1/jersey-core-1.19.1.jar, file:/D:/jar/com/sun/jersey/jersey-client/1.19.1/jersey-client-1.19.1.jar, file:/D:/jar/com/sun/jersey/contribs/jersey-apache-client4/1.19.1/jersey-apache-client4-1.19.1.jar, file:/D:/jar/org/apache/httpcomponents/httpclient/4.5.6/httpclient-4.5.6.jar, file:/D:/jar/org/apache/httpcomponents/httpcore/4.4.10/httpcore-4.4.10.jar, file:/D:/jar/commons-codec/commons-codec/1.11/commons-codec-1.11.jar, file:/D:/jar/com/google/inject/guice/4.1.0/guice-4.1.0.jar, file:/D:/jar/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/D:/jar/com/sun/jersey/jersey-servlet/1.19.1/jersey-servlet-1.19.1.jar, file:/D:/jar/com/sun/jersey/jersey-server/1.19.1/jersey-server-1.19.1.jar, file:/D:/jar/com/netflix/eureka/eureka-core/1.6.2/eureka-core-1.6.2.jar, file:/D:/jar/org/codehaus/woodstox/woodstox-core-asl/4.4.1/woodstox-core-asl-4.4.1.jar, file:/D:/jar/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar, file:/D:/jar/com/netflix/archaius/archaius-core/0.7.4/archaius-core-0.7.4.jar, file:/D:/jar/com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1.jar, file:/D:/jar/javax/inject/javax.inject/1/javax.inject-1.jar, file:/D:/jar/com/fasterxml/jackson/dataformat/jackson-dataformat-xml/2.9.7/jackson-dataformat-xml-2.9.7.jar, file:/D:/jar/com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.9.7/jackson-module-jaxb-annotations-2.9.7.jar, file:/D:/jar/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar, file:/D:/jar/com/fasterxml/woodstox/woodstox-core/5.0.3/woodstox-core-5.0.3.jar, file:/D:/jar/com/thoughtworks/xstream/xstream/1.4.9/xstream-1.4.9.jar, file:/D:/jar/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar, file:/D:/jar/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar, file:/D:/jar/org/springframework/cloud/spring-cloud-starter-archaius/1.3.6.RELEASE/spring-cloud-starter-archaius-1.3.6.RELEASE.jar, file:/D:/jar/commons-configuration/commons-configuration/1.8/commons-configuration-1.8.jar, file:/D:/jar/commons-lang/commons-lang/2.6/commons-lang-2.6.jar, file:/D:/jar/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar, file:/D:/jar/com/fasterxml/jackson/core/jackson-core/2.9.7/jackson-core-2.9.7.jar, file:/D:/jar/com/fasterxml/jackson/core/jackson-databind/2.9.7/jackson-databind-2.9.7.jar, file:/D:/jar/com/google/guava/guava/18.0/guava-18.0.jar, file:/D:/jar/org/springframework/cloud/spring-cloud-starter-ribbon/1.3.6.RELEASE/spring-cloud-starter-ribbon-1.3.6.RELEASE.jar, file:/D:/jar/com/netflix/ribbon/ribbon/2.2.2/ribbon-2.2.2.jar, file:/D:/jar/com/netflix/ribbon/ribbon-transport/2.2.2/ribbon-transport-2.2.2.jar, file:/D:/jar/io/reactivex/rxnetty-contexts/0.4.9/rxnetty-contexts-0.4.9.jar, file:/D:/jar/io/reactivex/rxnetty-servo/0.4.9/rxnetty-servo-0.4.9.jar, file:/D:/jar/com/netflix/hystrix/hystrix-core/1.5.12/hystrix-core-1.5.12.jar, file:/D:/jar/io/reactivex/rxnetty/0.4.9/rxnetty-0.4.9.jar, file:/D:/jar/io/netty/netty-codec-http/4.1.29.Final/netty-codec-http-4.1.29.Final.jar, file:/D:/jar/io/netty/netty-codec/4.1.29.Final/netty-codec-4.1.29.Final.jar, file:/D:/jar/io/netty/netty-transport-native-epoll/4.1.29.Final/netty-transport-native-epoll-4.1.29.Final.jar, file:/D:/jar/io/netty/netty-common/4.1.29.Final/netty-common-4.1.29.Final.jar, file:/D:/jar/io/netty/netty-buffer/4.1.29.Final/netty-buffer-4.1.29.Final.jar, file:/D:/jar/io/netty/netty-transport-native-unix-common/4.1.29.Final/netty-transport-native-unix-common-4.1.29.Final.jar, file:/D:/jar/io/netty/netty-transport/4.1.29.Final/netty-transport-4.1.29.Final.jar, file:/D:/jar/io/netty/netty-resolver/4.1.29.Final/netty-resolver-4.1.29.Final.jar, file:/D:/jar/com/netflix/ribbon/ribbon-core/2.2.2/ribbon-core-2.2.2.jar, file:/D:/jar/com/netflix/ribbon/ribbon-httpclient/2.2.2/ribbon-httpclient-2.2.2.jar, file:/D:/jar/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar, file:/D:/jar/com/netflix/netflix-commons/netflix-commons-util/0.1.1/netflix-commons-util-0.1.1.jar, file:/D:/jar/com/netflix/ribbon/ribbon-loadbalancer/2.2.2/ribbon-loadbalancer-2.2.2.jar, file:/D:/jar/com/netflix/netflix-commons/netflix-statistics/0.1.1/netflix-statistics-0.1.1.jar, file:/D:/jar/io/reactivex/rxjava/1.3.8/rxjava-1.3.8.jar, file:/D:/jar/com/netflix/ribbon/ribbon-eureka/2.2.2/ribbon-eureka-2.2.2.jar, file:/D:/jar/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar, file:/D:/software/IntelliJ%20IDEA%202017.3.4/lib/idea_rt.jar] 22:02:37.687 [background-preinit] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Log4j2LoggerProvider 22:02:37.689 [background-preinit] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 6.0.13.Final 22:02:37.716 [background-preinit] DEBUG org.hibernate.validator.internal.engine.resolver.TraversableResolvers - Cannot find javax.persistence.Persistence on classpath. Assuming non JPA 2 environment. All properties will per default be traversable. 22:02:37.721 [background-preinit] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - Trying to load META-INF/validation.xml for XML based Validator configuration. 22:02:37.722 [background-preinit] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via TCCL 22:02:37.722 [background-preinit] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via Hibernate Validator's class loader 22:02:37.723 [background-preinit] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - No META-INF/validation.xml found. Using annotation based configuration only. 22:02:37.908 [background-preinit] DEBUG org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator - Loaded expression factory via original TCCL 22:02:37.915 [background-preinit] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryImpl - HV000234: Using org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator as ValidatorFactory-scoped message interpolator. 22:02:37.915 [background-preinit] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryImpl - HV000234: Using org.hibernate.validator.internal.engine.resolver.TraverseAllTraversableResolver as ValidatorFactory-scoped traversable resolver. 22:02:37.916 [background-preinit] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryImpl - HV000234: Using org.hibernate.validator.internal.util.ExecutableParameterNameProvider as ValidatorFactory-scoped parameter name provider. 22:02:37.916 [background-preinit] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryImpl - HV000234: Using org.hibernate.validator.internal.engine.DefaultClockProvider as ValidatorFactory-scoped clock provider. 22:02:37.916 [background-preinit] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryImpl - HV000234: Using org.hibernate.validator.internal.engine.scripting.DefaultScriptEvaluatorFactory as ValidatorFactory-scoped script evaluator factory. 22:02:38.270 [main] ERROR org.springframework.boot.SpringApplication - Application run failed java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:157) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:98) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:64) 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:74) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:338) at org.springframework.boot.SpringApplication.run(SpringApplication.java:297) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1242) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1230) at com.study.euraka.StudyEurakaApplication.main(StudyEurakaApplication.java:15) Process finished with exit code 1
原因:
springboot和springcloud版本不匹配
解决:
降低springcloud的版本为:1.5.9.RELEASE
本文来自博客园,作者:zhangpba,转载请注明原文链接:https://www.cnblogs.com/zhangpb/p/14232924.html