Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15752

Camel-Kafka: Exception java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/JsonNode on Camel-Kafka component

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.6.0
    • 3.7.0
    • camel-kafka
    • None
    • Unknown

    Description

      Hi,

      I have an application using camel-kafka 3.4.4 (which has kafka 2.5.0 as dependency).

      When I switch to use camel-kafka 3.6.0 (which has kafka 2.6.0 as dependency), I get the following exception.

       {{020-10-24 19:23:45 ERROR KafkaThread:49 - Uncaught exception in thread 'kafka-producer-network-thread | raw-packets':

       java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/JsonNode
       at org.apache.kafka.common.requests.ApiVersionsRequest$Builder.<clinit>(ApiVersionsRequest.java:36)
       at org.apache.kafka.clients.NetworkClient.handleConnections(NetworkClient.java:910)
       at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:555)
       at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:325)
       at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:240)
       at java.base/java.lang.Thread.run(Thread.java:834)
       Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.JsonNode
       at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
       at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
       at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
       ... 6 more}}

      Adding the explicit dependency to jackson-databind as following solves the problem

      <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.11.3</version>
      </dependency>
      

      As reference, this is the parent pom.xml in my project where I set camel-kafka version (but even Kafka version, which is used in other modules).

      https://github.com/ppatierno/formula1-telemetry-kafka/blob/master/pom.xml

      and following the pom.xml of the specific application using camel-kafka (where I have to add the jackson-databind reference for fixing the exception).

      https://github.com/ppatierno/formula1-telemetry-kafka/blob/master/f1-telemetry-udp-kafka/pom.xml

       

      Attachments

        Activity

          People

            acosentino Andrea Cosentino
            ppatierno Paolo Patierno
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: