-1

我正在尝试在本地运行基本的 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 集成示例: data-artisans

4

1 回答 1

0

该问题已在 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。

于 2015-11-08T12:33:49.863 回答