Skip to content

[Bug] Observability-starter Consider renaming one of the beans or enabling overriding #14628

@he-jialin2

Description

@he-jialin2

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo 3.2.15
dubbo-spring-boot-observability-starter 3.2.15
SpringBoot 3.2.1
spring-boot-actuator-autoconfigure 3.2.1

Steps to reproduce this issue

According to dubbo3 design specifications, spring.main.allow-bean-definition-overriding=true should not be set as the default, so this problem needs to be fixed.

[2024-09-05 09:17:22] WARN [traceId=] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'correlationFieldsCorrelationScopeCustomizer' defined in class path resource [org/apache/dubbo/spring/boot/observability/autoconfigure/brave/BraveAutoConfiguration$BraveBaggageConfiguration.class]: Cannot register bean definition [Root bean: class [null]; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.apache.dubbo.spring.boot.observability.autoconfigure.brave.BraveAutoConfiguration$BraveBaggageConfiguration; factoryMethodName=correlationFieldsCorrelationScopeCustomizer; initMethodNames=null; destroyMethodNames=[(inferred)]; defined in class path resource [org/apache/dubbo/spring/boot/observability/autoconfigure/brave/BraveAutoConfiguration$BraveBaggageConfiguration.class]] for bean 'correlationFieldsCorrelationScopeCustomizer' since there is already [Root bean: class [null]; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.tracing.BravePropagationConfigurations$PropagationWithBaggage; factoryMethodName=correlationFieldsCorrelationScopeCustomizer; initMethodNames=null; destroyMethodNames=[(inferred)]; defined in class path resource [org/springframework/boot/actuate/autoconfigure/tracing/BravePropagationConfigurations$PropagationWithBaggage.class]] bound.

What you expected to happen

It can run normally without setting spring.main.allow-bean-definition-overriding=true

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions