0

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)
Giorgos Myrianthous
  • 36,235
  • 20
  • 134
  • 156

2 Answers2

1

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="" 
Giorgos Myrianthous
  • 36,235
  • 20
  • 134
  • 156
0

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

zooes
  • 1,280
  • 3
  • 15
  • 21