11

APPLICATION FAILED TO START


Description:

The bean 'counterFactory', defined in class path resource [org/springframework/cloud/netflix/zuul/ZuulServerAutoConfiguration$ZuulCounterFactoryConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/cloud/netflix/zuul/ZuulServerAutoConfiguration$ZuulMetricsConfiguration.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

Prudhvi Gudala
  • 113
  • 1
  • 5

2 Answers2

14

Use the Spring Boot version of 2.0.x...they haven't introduced the Zuul support for 2.1.x

Thanks

Bhanuj
  • 156
  • 1
  • 4
-2

This will solve by adding below config in yml or properties file.

    spring:
      main:
        allow-bean-definition-overriding: true
chmk
  • 57
  • 1
  • 8
  • However, be cautious when enabling bean definition overriding, as it may cause unexpected behavior if multiple beans with the same name are defined and overridden without proper understanding of their intended usage and dependencies. It's recommended to choose the appropriate option based on your application's requirements and design. Renaming the beans to have unique names is usually a safer approach to avoid conflicts and ensure proper separation of concerns. – West Side Apr 23 '23 at 13:19