Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Kafka Producer/Consumer error - JNI error

Kafka Producer/Consumer error - JNI error

New Contributor

I am new to Kafka. While running Kafka Producer and Consumer examples programs (Scala) on HDP 2.6 sandbox , I am getting the following error. I've also enclosed the POM file. Appreciate any help. Thanks!

Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/kafka/clients/producer/KafkaProducer at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods( at java.lang.Class.privateGetMethodRecursive( at java.lang.Class.getMethod0( at java.lang.Class.getMethod( at sun.launcher.LauncherHelper.validateMainClass( at sun.launcher.LauncherHelper.checkAndLoadMain( Caused by: java.lang.ClassNotFoundException: org.apache.kafka.clients.producer.KafkaProducer at

Pom file:

Don't have an account?
Coming from Hortonworks? Activate your account here