开发者社区> 问答> 正文

java的api 消费kafka报错,,java.lang.NoClassDef?400报错

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/kafka/common/security/JaasUtils
    at kafka.consumer.ZookeeperConsumerConnector.connectZk(ZookeeperConsumerConnector.scala:184)
    at kafka.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:129)
    at kafka.javaapi.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:66)
    at kafka.javaapi.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:69)
    at kafka.consumer.Consumer$.createJavaConsumerConnector(ConsumerConnector.scala:120)
    at kafka.consumer.Consumer.createJavaConsumerConnector(ConsumerConnector.scala)
    at org.apache.spark.examp.SimpleConsumer.<init>(SimpleConsumer.java:29)
    at org.apache.spark.examp.SimpleConsumer.main(SimpleConsumer.java:24)
Caused by: java.lang.ClassNotFoundException: org.apache.kafka.common.security.JaasUtils
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)

展开
收起
爱吃鱼的程序员 2020-06-08 12:48:36 1223 0
2 条回答
写回答
取消 提交回答
  • 检查是否没有依赖jar包,或者是否有jar包冲突导致

    2020-06-23 17:35:06
    赞同 展开评论 打赏
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    缺Jar包

    兄弟问题找到了吗

    2020-06-08 12:48:51
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Boot2.0实战Redis分布式缓存 立即下载
CUDA MATH API 立即下载
API PLAYBOOK 立即下载