spring cloud eureka 初始化报错(A bean with that name has already been defined)
最后发现引用了 spring-cloud-context,怀疑是版本冲突,去掉后问题修复。
报错内容
The bean ‘eurekaRegistration’, defined in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfigurationEurekaClientConfiguration.class],couldnotberegistered.Abeanwiththatnamehasalreadybeendefinedinclasspathresource[org/springframework/cloud/netflix/eureka/EurekaClientAutoConfigurationEurekaClientConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfigurationEurekaClientConfiguration.class],couldnotberegistered.Abeanwiththatnamehasalreadybeendefinedinclasspathresource[org/springframework/cloud/netflix/eureka/EurekaClientAutoConfigurationRefreshableEurekaClientConfiguration.class] and overriding is disabled.
排查
原因大概就是依赖冲突、版本冲突之类的,根据以下答案尝试后没有修复:
https://stackoverflow.com/questions/62868281/bean-eurekaregistration-defined-in-class-path-resource-could-not-be-registere
https://developer.baidu.com/article/details/3234921
https://www.volcengine.com/theme/8366164-OTHER-7-1
最后发现引用了 spring-cloud-context,怀疑是版本冲突,去掉后问题修复。
更多推荐
所有评论(0)