Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

java.lang.NoSuchMethodError: org.apache.kafka.common.metrics.Sensor.add error in kafka streams

Ask Question

I am getting the below exception when I try to create a kafka streams instance.
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.kafka.common.metrics.Sensor.add(Lorg/apache/kafka/common/MetricName;Lorg/apache/kafka/common/metrics/MeasurableStat;)Z at org.apache.kafka.streams.processor.internals.metrics.StreamsMetricsImpl.<init>(StreamsMetricsImpl.java:64) at org.apache.kafka.streams.processor.internals.StreamThread$StreamsMetricsThreadImpl.<init>(StreamThread.java:525) at org.apache.kafka.streams.processor.internals.StreamThread.create(StreamThread.java:618) at org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:706) at org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:624) at org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:534)

I am trying to run the WordCountDemo scala example in intellij but unable to do so. I have org.apache.kafka:kafka-streams-scala_2.11:2.1.0 and org.apache.kafka:kafka-clients:1.0.2 dependencies included in my project and see the jars imported.

You will need same client version org.apache.kafka:kafka-clients:2.1.0 that matches KafkaStreams version. Matthias J. Sax Nov 27, 2018 at 0:55

The answer was already found in the comments by @Matthias

You will need same client version org.apache.kafka:kafka-clients:2.1.0 that matches KafkaStreams version

This was confirmed to work for the asker.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .