Kafka + Flink unusual java.lang.NoClassDefFoundError: org / apache / flink / streaming / util / serialization / DeserializationSchema

I have written to debug example Flink IDEA in Kafka + environment

The code is compiled through, but when Debug debugging, appear as abnormal;

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

The configuration of the maven, also equipped with the additional jar also added.

Life and death is not DEBUG, boot error, can not directly start;

Looking for a long reason, finally found the reason:

In the  Run / Edit Configurations  in check  with "Provided" scope Include dependencies after, save and run just fine.

 

 

Get.

Guess you like

Origin www.cnblogs.com/alexgl2008/p/12387356.html