miles02 / blog-comments

0 stars 0 forks source link

SpringCloud教程第5篇:Zuul(F版本) - 方志朋的博客 #25

Open forezp opened 6 years ago

forezp commented 6 years ago

https://www.fangzhipeng.com/springcloud/2018/08/30/sc-f5-zuul/

方志朋的博客

HouQ commented 6 years ago

启动zuul时报错:

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

weifengchui commented 5 years ago

@HouQ 启动zuul时报错:

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

可能是spring-boot的版本和spring-cloud的版本不匹配导致的。 我的spring-cloud版本是Finchley.RELEASE,如果用spring-boot版本2.0.6.RELEASE是正常的,如果用spring-boot版本2.1.0.RELEASE,启动会类似错误。 仅供参考。

HouQ commented 5 years ago

@weifwngchui

@HouQ 启动zuul时报错:

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

可能是spring-boot的版本和spring-cloud的版本不匹配导致的。 我的spring-cloud版本是Finchley.RELEASE,如果用spring-boot版本2.0.6.RELEASE是正常的,如果用spring-boot版本2.1.0.RELEASE,启动会类似错误。 仅供参考。

是的,改了版本号就好了,感谢。

JavaAdvancer commented 5 years ago

请教个问题:为何加了路由之后,前面的 断路器 就不好使了呢?