zoukankan      html  css  js  c++  java
  • springcloud 启动错误

    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration': Unsatisfied dependency expressed through field 'eurekaServerBootstrap'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eurekaServerBootstrap' defined in class path resource [org/springframework/cloud/netflix/eureka/server/EurekaServerAutoConfiguration.class]: Unsatisfied dependency expressed through method 'eurekaServerBootstrap' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'peerAwareInstanceRegistry' defined in class path resource [org/springframework/cloud/netflix/eureka/server/EurekaServerAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.eureka.registry.PeerAwareInstanceRegistry]: Factory method 'peerAwareInstanceRegistry' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.eurekaClient' defined in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.discovery.EurekaClient]: Factory method 'eurekaClient' threw exception; nested exception is java.lang.RuntimeException: Failed to initialize DiscoveryClient!

          <!-- eureka-server -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-eureka-server</artifactId>
            </dependency>
            <!-- Eureka -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-netflix-eureka-server</artifactId>
                <!--<version>2.2.0.BUILD-SNAPSHOT</version>-->
            </dependency>
    
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
            </dependency>

    第一、没有添加 hystrix,这是因为新版本的Spring Cloud对熔断器Hystrix有要求,Eureka中必须添加对Hystrix的依赖才可以正常启动。

    第二、给 eureka-sever 添加了多余的版本号。

    如果接收到:java.lang.ClassNotFoundException:org.apache.http.config.RegistryBuilder 这个错误

     还是不行的话可以加上

        <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpcore</artifactId>
                <version>4.3.3</version>
            </dependency>
  • 相关阅读:
    [转]好习惯养成的10个步骤
    模拟资料
    [转]暗时间
    [转]30个小改变,造就你的卓越人生
    [转]Word 2007文档中图片不显示或对象不显示的解决方法
    ubuntu 10.04 安转2.6.38内核
    [转]可以让你少奋斗10年的工作经验
    [转]Vim 复制粘帖格式错乱问题的解决办法
    C# 获取类中所有的属性
    sql 脚本
  • 原文地址:https://www.cnblogs.com/alomsc/p/13785261.html
Copyright © 2011-2022 走看看