You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by "wangweiguang@stevegame.cn" <wa...@stevegame.cn> on 2020/04/13 07:06:38 UTC

回复: 回复:Flink 1.10读取kafka数据,打包jar,提交任务到集群运行测试,遇到java.lang.NoClassDefFoundError: org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumerBase问题,求救大神帮忙解答,谢谢!

感谢各位flink道友帮忙解答

  检查了下,/lib 中缺少了:flink-connector-kafka_2.11-1.10.0.jar,flink-connector-kafka-base_2.11-1.10.0.jar,kafka-clients-1.0.1-kafka-3.1.1.jar (根据自己的集群kafka版本来选择)这些jar,添加后程序运行成功!

发件人: 1035262083
发送时间: 2020-04-13 14:33
收件人: user-zh; user-zh
主题: 回复:Flink 1.10读取kafka数据,打包jar,提交任务到集群运行测试,遇到java.lang.NoClassDefFoundError: org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumerBase问题,求救大神帮忙解答,谢谢!
你应该还缺少flink-connector-elasticsearch-base_2.11-1.10.0.jar
 
 
 
------------------&nbsp;原始邮件&nbsp;------------------
发件人: "wangweiguang@stevegame.cn"<wangweiguang@stevegame.cn&gt;; 
发送时间: 2020年4月13日(星期一) 下午2:31
收件人: "user-zh"<user-zh@flink.apache.org&gt;; 
主题: Flink 1.10读取kafka数据,打包jar,提交任务到集群运行测试,遇到java.lang.NoClassDefFoundError: org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumerBase问题,求救大神帮忙解答,谢谢!
 
 
 
 
 
你好:
 
 
&nbsp; &nbsp; 我在用Flink 1.10读取kafka数据,本地IDEA环境执行没有问题,将代码编译打包(不是fat jar)到集群上运行测试,执行提示:java.lang.NoClassDefFoundError: org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumerBase问题。
&nbsp; &nbsp; 我在Flink 1.10集群的每个节点下的 /lib下都添加了kafka依赖包:flink-connector-kafka_2.11-1.10.0.jar
&nbsp; &nbsp; 我启动的命令:
&nbsp; &nbsp; 我先启动了一个Yarn session:
&nbsp; &nbsp; yarn-session.sh -yd -jm 2048m -tm 2048m -s 10
&nbsp; &nbsp; 然后在session提交任务测试
&nbsp; &nbsp; flink run -d -p 2 -m yarn-cluster -c com.sdf.flink.streaming.BroadcastOrderJoinGoodsName -yid application_1585277813790_0006 ./flink-project_1.10.0-1.0.jar
&nbsp; &nbsp; 启动就报如下错误:
&nbsp; &nbsp;
 
 
/lib下的依赖包:
 
 
 
代码片段:
 
 
就是简单的读取数据,输出测试!
 
 
 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
 
 
 
 
 
 
 
 
 
 
 
 
 
史蒂夫软件(深圳)有限公司
技术部 &nbsp; 王卫光
wangweiguang@stevegame.cn&nbsp;
地址/Add:深圳南山科区科技园高新南十二道康佳研发大厦A座
手机/Mob:13128970998
http://www.stevengame.com/