【问题标题】:Facing issue with Microservice using netflix zuul in SpringBoot在 Spring Boot 中使用 netflix zuul 面临微服务问题
【发布时间】:2019-01-27 21:42:46
【问题描述】:

应用程序启动失败


说明:

无法注册在类路径资源 [org/springframework/cloud/netflix/zuul/ZuulServerAutoConfiguration$ZuulCounterFactoryConfiguration.class] 中定义的 bean 'counterFactory'。已在类路径资源 [org/springframework/cloud/netflix/zuul/ZuulServerAutoConfiguration$ZuulMetricsConfiguration.class] 中定义了具有该名称的 bean,并且已禁用覆盖。

行动:

考虑重命名其中一个 bean 或通过设置 spring.main.allow-bean-definition-overriding=true 来启用覆盖

【问题讨论】:

  • 如果你使用 Maven,请分享你的 pom.xml
  • org.springframework.cloudspring-cloud-starter-netflix-zuul

标签: microservices netflix-zuul


【解决方案1】:

使用 2.0.x 的 Spring Boot 版本...他们还没有引入对 2.1.x 的 Zuul 支持

谢谢

【讨论】:

  • 但是有没有办法支持 2.1.x。还有吗?
  • 没有。 Spring 2.1 版本不支持它。可能在未来。到那时你也可以使用 2.0.X 版本,它具有相同的功能......
【解决方案2】:

这将通过在 yml 或属性文件中添加以下配置来解决。

    spring:
      main:
        allow-bean-definition-overriding: true

【讨论】:

    猜你喜欢
    • 2019-09-11
    • 2016-11-13
    • 2018-08-21
    • 2019-02-13
    • 1970-01-01
    • 2019-02-12
    • 2017-07-07
    • 1970-01-01
    • 2020-08-15
    相关资源
    最近更新 更多