[ 
https://issues.apache.org/jira/browse/CAMEL-14324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dietrich Schulten updated CAMEL-14324:
--------------------------------------
    Description: 
When {{useMDCLogging}} is set to true on a CamelContext with camel-zipkin, the 
application fails to start. The error message is 
{{java.lang.NoClassDefFoundError: 
brave/internal/propagation/CorrelationFieldScopeDecorator}}.

The reason might be that the {{brave.context.slf4j.MDCScopeDecorator}} from 
{{brave-context-slf4}}j, introduced into ZipkinTracer with CAMEL-12721, extends 
{{brave.internal.propagation.CorrelationFieldScopeDecorator}}, which is not 
exported by the brave bundle 
[https://github.com/openzipkin/brave/tree/5.6.5/brave], according to its 
[bnd.bnd|[https://github.com/openzipkin/brave/blob/5.6.5/brave/bnd.bnd]] file. 
Possibly this is why the [instance 
creation|https://github.com/apache/camel/blob/e46b2d916aa748dfd292190ed52b9d3413ceb70d/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinTracer.java#L576]
 fails.

The solution could be to use only exported brave classes (effectively 
recreating {{MDCScopeDecorator}}) or maybe let OSGi create the 
{{MDCScopeDecorator }}instance.

  was:
When `useMDCLogging` is set to true on a CamelContext with camel-zipkin, the 
application fails to start. The error message is 
`java.lang.NoClassDefFoundError: 
brave/internal/propagation/CorrelationFieldScopeDecorator`.

The reason might be that the `brave.context.slf4j.MDCScopeDecorator` from 
brave-context-slf4j, introduced into ZipkinTracer with CAMEL-12721, extends 
`brave.internal.propagation.CorrelationFieldScopeDecorator`, which is not 
exported by the brave bundle 
[https://github.com/openzipkin/brave/tree/5.6.5/brave], according to its 
[bnd.bnd|[https://github.com/openzipkin/brave/blob/5.6.5/brave/bnd.bnd]] file. 
Possibly this is why the [instance 
creation|https://github.com/apache/camel/blob/e46b2d916aa748dfd292190ed52b9d3413ceb70d/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinTracer.java#L576]
 fails.

The solution could be to use only exported brave classes (effectively 
recreating MDCScopeDecorator) or maybe let OSGi create the `MDCScopeDecorator` 
instance.


> Brave MDC Integration does not work in Karaf
> --------------------------------------------
>
>                 Key: CAMEL-14324
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14324
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-zipkin
>            Reporter: Dietrich Schulten
>            Priority: Major
>
> When {{useMDCLogging}} is set to true on a CamelContext with camel-zipkin, 
> the application fails to start. The error message is 
> {{java.lang.NoClassDefFoundError: 
> brave/internal/propagation/CorrelationFieldScopeDecorator}}.
> The reason might be that the {{brave.context.slf4j.MDCScopeDecorator}} from 
> {{brave-context-slf4}}j, introduced into ZipkinTracer with CAMEL-12721, 
> extends {{brave.internal.propagation.CorrelationFieldScopeDecorator}}, which 
> is not exported by the brave bundle 
> [https://github.com/openzipkin/brave/tree/5.6.5/brave], according to its 
> [bnd.bnd|[https://github.com/openzipkin/brave/blob/5.6.5/brave/bnd.bnd]] 
> file. Possibly this is why the [instance 
> creation|https://github.com/apache/camel/blob/e46b2d916aa748dfd292190ed52b9d3413ceb70d/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinTracer.java#L576]
>  fails.
> The solution could be to use only exported brave classes (effectively 
> recreating {{MDCScopeDecorator}}) or maybe let OSGi create the 
> {{MDCScopeDecorator }}instance.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to