问题
在使用springboot搭建zuul的过程中,运行时报如下错误:
***************************
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
原因
springboot2.1.1RELEASE 版本问题,隐藏BUG
解决方案
使用2.0~2.1中间的版本,如2.0.6 RELEASE等