*************************** 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 |
---|---|
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>