闲来无事,手贱把网关项目zuul中的SpringBoot2.0.3.RELEASE 版本改为了2.1.3.RELEASE ,然后重新启动项目之后,出现了如下问题(接触不久,一阵小心心慌慌)
***************************
APPLICATION FAILED TO START
***************************
Description:
The bean 'proxyRequestHelper', defined in class path resource [org/springframework/cloud/netflix/zuul/ZuulProxyAutoConfiguration$NoActuatorConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/cloud/netflix/zuul/ZuulProxyAutoConfiguration$EndpointConfiguration.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和SpringCloud 版本没有匹配上,然后去查了下Spring官网资料,印证了自己的想法,下图是SpringCloud中的解释

所在根据相应的SpringBoot 版本配置相对应的SpringCloud 版本即可解决该问题。
本文记录了一次因将Zuul项目中SpringBoot版本从2.0.3.RELEASE升级到2.1.3.RELEASE后,遇到的APPLICATIONFAILEDTOSTART错误,并详细描述了解决过程。主要问题是SpringBoot和SpringCloud版本不匹配导致的bean注册冲突。解决方案是调整SpringCloud版本以适配SpringBoot版本。
1661

被折叠的 条评论
为什么被折叠?



