Eureka 启动报错

红太狼 2023-10-07 11:19 138阅读 0赞
  1. ***************************
  2. APPLICATION FAILED TO START
  3. ***************************
  4. Description:
  5. The bean 'eurekaRegistration', defined in class path resource
  6. [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration$EurekaClientConfigu
  7. ration.class], could not be registered. A bean with that name has already been defined in
  8. class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration$RefreshableEurekaC
  9. lientConfiguration.class] and overriding is disabled.
  10. Action:
  11. Consider renaming one of the beans or enabling overriding by setting spring.main.allow
  12. -bean-definition-overriding=true

1.报错原因

说是由于springboot和springcloud版本冲突导致的,

已经注册过了,还有一个重复的导致的,子工程引入eureka-server的时候引入错误了

原来引入的pom文件

  1. <dependency>
  2. <groupId>org.springframework.cloud</groupId>
  3. <artifactId>spring-cloud-netflix-eureka-server</artifactId>
  4. </dependency>

2.解决办法更改依赖

  1. <dependency>
  2. <groupId>org.springframework.cloud</groupId>
  3. <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
  4. </dependency>

发表评论

表情:
评论列表 (有 0 条评论,138人围观)

还没有评论,来说两句吧...

相关阅读