springboot运行zuul时启动报错counterFactory could not be registered

报错如下:

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

错误原因:

springboot 2.1.0版本不兼容的问题

解决办法:

将版本修改成2.0.5即成功

    
        org.springframework.boot
        spring-boot-starter-parent
        2.0.5.RELEASE
         
    

 

你可能感兴趣的:(SpringCloud)