• (黑马十次方项目day07)The bean 'eurekaRegistration', defined in class path resource


    ***************************
    APPLICATION FAILED TO START
    ***************************
    
    Description:
    
    The bean 'eurekaRegistration', defined in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration$EurekaClientConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration.class] and overriding is disabled.
    
    Action:
    
    Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
    
    
    进程已结束,退出代码 1

    意思是说 eurekaRegistration 重复注册了,

    Action:可以考虑重命名其中一个bean,或者通过设置spring.main.allow-bean-definition- override =true来启用覆盖

    网上说可能是spring boot 和 spring cloud 版本冲突,具体版本参考Spring 官方对应版本地址:  (https://start.spring.io/actuator/info)

    spring boot 和 spring cloud 大版本对应
    Spring BootSpring Cloud
    1.2.x Angel版本
    1.3.x Brixton版本
    1.4.x stripes Camden版本
    1.5.x Dalston版本、Edgware版本
    2.0.x Finchley版本
    2.1.x Greenwich.SR2

    但是此次问题是maven依赖导错了。

    之前导的是:

    <dependency>
         <groupId>org.springframework.cloud</groupId>
         <artifactId>spring-cloud-netflix-eureka-server</artifactId>
    </dependency>

    改正: 

    <dependency>
         <groupId>org.springframework.cloud</groupId>
         <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
    </dependency>
  • 相关阅读:
    JAVA进阶17
    JAVA进阶16
    Map in C++ Standard Template Library (STL)
    数据结构入门
    Day 17:Python 对象的相等性比较
    cmd of windows
    Nmap扫描工具
    Day16: python生产列表的使用方法
    Day 15:一些数据分析、机器学习和深度学习包和框架&&入门案例
    端口
  • 原文地址:https://www.cnblogs.com/beiweixiaohuo/p/12953520.html
Copyright © 2020-2023  润新知