我正在尝试在本地运行一个基本的Flink流作业(在java中)。当我使用eclipse运行我的应用程序时,它就像一个魅力。但是当我使用Flink命令行界面运行时,我会得到以下异常
10/29/2015 11:15:54 Grouped Aggregation -> (Map -> Stream Sink,Stream Sink)(7/8) switched to SCHEDULED
10/29/2015 11:15:54 Grouped Aggregation -> (Map -> Stream Sink, Stream Sink)(7/8) switched to DEPLOYING
10/29/2015 11:15:54 Grouped Aggregation -> (Map -> Stream Sink, Stream Sink)(8/8) switched to SCHEDULED
10/29/2015 11:15:54 Grouped Aggregation -> (Map -> Stream Sink, Stream Sink)(8/8) switched to DEPLOYING
10/29/2015 11:15:54 Custom Source -> Flat Map -> Map(5/8) switched to FAILED
java.lang.Exception: Could not load the task's invokable class.
at org.apache.flink.runtime.taskmanager.Task.loadAndInstantiateInvokable(Tas k.java:696)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:450)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: class org.apache.flink.streaming.runtime.tasks.SourceStreamTask
at java.lang.Class.asSubclass(Class.java:3404)
at org.apache.flink.runtime.taskmanager.Task.loadAndInstantiateInvokable(Tas k.java:693)
... 2 more
10/29/2015 11:15:54 Custom Source -> Flat Map -> Map(2/8) switched to FAILED
java.lang.Exception: Could not load the task's invokable class.
at org.apache.flink.runtime.taskmanager.Task.loadAndInstantiateInvokable(Tas k.java:696)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:450)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: class org.apache.flink.streaming.runtime.tasks.SourceStreamTask
at java.lang.Class.asSubclass(Class.java:3404)
at org.apache.flink.runtime.taskmanager.Task.loadAndInstantiateInvokable(Tas k.java:693)
... 2 more
我正在以下位置运行Flink Kafka集成示例:数据工匠
Flink邮件列表上已经回答了这个问题:http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Could-not-load-the-task-s-invokable-class-td3336.html
问题是Flink程序的jar是使用Eclipse构建的。用户能够使用Maven构建一个工作jar。