Abhishek Deepankar
Abhishek Deepankar

Reputation: 13

Unable to run Kafka Console Producer (NoSuchMethodError)

Error while running kafka producer

./kafka-console-producer.sh --broker-list localhost:9092 --topic testing
Exception in thread "main" java.lang.NoSuchMethodError: kafka.utils.CommandLineUtils$.parseKeyValueArgs(Lscala/collection/Iterable;)Ljava/util/Properties;
    at kafka.tools.ConsoleProducer$ProducerConfig.<init>(ConsoleProducer.scala:245)
    at kafka.tools.ConsoleProducer$.main(ConsoleProducer.scala:35)
    at kafka.tools.ConsoleProducer.main(ConsoleProducer.scala)

Upvotes: 0

Views: 543

Answers (2)

zooes
zooes

Reputation: 1468

Looks like you either have conflicting jars in your classpath or you have mismatched versions of kafka broker and kafka client.

Upvotes: 0

Giorgos Myrianthous
Giorgos Myrianthous

Reputation: 39930

This kind of error is usually related to mismatched versions of Kafka jars. If this is the case, resetting your CLASSPATH should do the trick:

export CLASSPATH="" 

Upvotes: 1

Related Questions