首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >已经定义了bean‘spring.sleuth.bagage-keys’

已经定义了bean‘spring.sleuth.bagage-keys’
EN

Stack Overflow用户
提问于 2021-11-16 10:42:08
回答 1查看 267关注 0票数 0

我正在将一个应用程序从Spring Boot 1.x升级到Spring Boot 2.x。当我尝试运行一个现有的(和之前有效的)单元测试时,我看到了以下输出:

代码语言:javascript
运行
AI代码解释
复制
***************************
APPLICATION FAILED TO START
***************************

Description:

The bean 'spring.sleuth.baggage-keys', defined in class path resource [org/springframework/cloud/sleuth/autoconfig/brave/BraveBaggageConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/cloud/sleuth/autoconfig/TraceBaggageConfiguration.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

我的Gradle项目使用以下实现:'org.springframework.cloud:spring-cloud-sleuth-core:2.2.8.RELEASE'

我试着和the Gradle dependencies task确认一下,以确保spring-cloud-sleuth-core和friends没有冲突的版本。我还研究了this postthis post,但它们并没有解决我的问题。

我需要避免重写bean,并且我的部署目标目前只能使用Spring Boot 2.4.x。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-11-16 11:35:29

检查compatibility matrix,你应该使用Spring Cloud 2020.0.x (Sleuth 3.x)和Spring Boot2.4(或2.5)。

Sleuth 2.2.8是Spring Cloud Hoxton,它与Boot 2.4不兼容。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69994509

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档