Tracing: Failed to capture tracing data: java.lang.ClassCastException: class com.example.model.AvroEntry cannot be cast to class java.lang.String

Solution Verified - Updated -

Issue

When using Camel with Open Tracing and Quarkus the fallwoing warning can bee seen:

2021-07-19 14:53:39,648 WARN  [org.apa.cam.tra.Tracer] (vert.x-worker-thread-1) Tracing: Failed to capture tracing data: java.lang.ClassCastException: class com.example.model.AvroEntry cannot be cast to class java.lang.String (com.example.model.AvroEntry is in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @46dd830d; java.lang.String is in module java.base of loader 'bootstrap')
        at org.apache.camel.tracing.decorators.KafkaSpanDecorator.pre(KafkaSpanDecorator.java:75)
        at org.apache.camel.tracing.Tracer$TracingEventNotifier.notify(Tracer.java:246)
        at org.apache.camel.support.EventHelper.doNotifyEvent(EventHelper.java:1240)
        at org.apache.camel.support.EventHelper.notifyExchangeSending(EventHelper.java:704)
        at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:140)
        at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:395)
        at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
        at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
        at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:312)
        at org.apache.camel.component.platform.http.vertx.VertxPlatformHttpConsumer.lambda$handleRequest$2(VertxPlatformHttpConsumer.java:184)
        at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$2(ContextImpl.java:313)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:829

Environment

  • Red Hat Fuse
    • 7
  • Red Hat Quarkus
    • 1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content