码迷,mamicode.com
首页 > 编程语言 > 详细

Kafka + Flink 出现异常 java.lang.NoClassDefFoundError: org/apache/flink/streaming/util/serialization/DeserializationSchema

时间:2020-03-01 00:07:36      阅读:305      评论:0      收藏:0      [点我收藏+]

标签:clu   launcher   enc   get   调试   nat   check   ima   出现   

我在 IDEA 环境中调试 Kafka+Flink 自己编写的例子时

代码编译都是通过的,但是进行Debug调试时,出现如下异常;

java.lang.NoClassDefFoundError: org/apache/flink/streaming/util/serialization/DeserializationSchema
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.apache.flink.streaming.util.serialization.DeserializationSchema
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Disconnected from the target VM, address: ‘127.0.0.1:55548‘, transport: ‘socket‘
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" 
Process finished with exit code 1

该配置maven的,也配置了,该加的jar也加了。

死活就是无法DEBUG,启动报错,直接就不能启;

找了很久原因,最终找到了原因:

在 Run/ Edit Configurations 中勾选 Include dependencies with “Provided” scope,保存之后再运行就好了。

技术图片

 

 

搞定。

Kafka + Flink 出现异常 java.lang.NoClassDefFoundError: org/apache/flink/streaming/util/serialization/DeserializationSchema

标签:clu   launcher   enc   get   调试   nat   check   ima   出现   

原文地址:https://www.cnblogs.com/alexgl2008/p/12387356.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!