A bean with that name has already been defined in class path resource [org/springframework/cloud/commons/security/ResourceServerTokenRelayAutoConfiguration.class] and overriding is disabled.
完整报错信息如下:
***************************
APPLICATION FAILED TO START
***************************
Description:
The bean 'accessTokenContextRelay', defined in class path resource [org/springframework/cloud/security/oauth2/client/ResourceServerTokenRelayAutoConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/cloud/commons/security/ResourceServerTokenRelayAutoConfiguration.class] and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
Process finished with exit code 1
如下图
原因:
重名
解决方案:
其实方案已经告诉我们:
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
添加配置:
或起别名
即可解决!!
..
..
Thanks