问答详情
源自:3-2 单节点 Eureka Server 的开发

EurekaApplication运行之后,控制塔报错

2020-10-06 13:34:24.407 ERROR 23000 --- [           main] o.s.b.web.embedded.tomcat.TomcatStarter  : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'org.springframework.cloud.netflix.eureka.server.EurekaServerAutoConfiguration': Unsatisfied dependency expressed through field 'eurekaServerConfig'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eurekaServerConfig' defined in class path resource [org/springframework/cloud/netflix/eureka/server/EurekaServerAutoConfiguration$EurekaServerConfigBeanConfiguration.class]: Unsatisfied dependency expressed through method 'eurekaServerConfig' parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'eurekaClientConfigBean': Could not bind properties to 'EurekaClientConfigBean' : prefix=eureka.client, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'eureka.client.service-url' to java.util.Map<java.lang.String, java.lang.String>


提问者:慕后端4304658 2020-10-06 13:41

个回答

  • 梦转千痕
    2020-11-04 11:15:39

    看你这块的版本号正确吗?Spring boot和Spring cloud的版本号要相同
    <!-- eureka server: 提供服务发现与服务注册 -->
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
            <version>2.1.4.RELEASE</version>
        </dependency>
    </dependencies>