简体   繁体   English

flink-quickstart-java 线程“main”中的异常 java.lang.RuntimeException:尚未创建数据接收器

[英]flink-quickstart-java Exception in thread "main" java.lang.RuntimeException: No data sinks have been created yet

I have just created new Flink project using maven archetype (ie template) (Looking at this article)我刚刚使用 maven 原型(即模板)创建了新的 Flink 项目(查看这篇文章)

mvn archetype:generate                               \
      -DarchetypeGroupId=org.apache.flink              \
      -DarchetypeArtifactId=flink-quickstart-java

1.14.4 is current version. 1.14.4 是当前版本。 The project can compile.该项目可以编译。 But when running either BatchJob or StreamingJob但是当运行BatchJobStreamingJob

public class BatchJob {

    public static void main(String[] args) throws Exception {
        // set up the batch execution environment
        final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

The first Exception NoClassDefFoundError: org/apache/flink/streaming/api/environment/StreamExecutionEnvironment can be solved as in java.lang.NoClassDefFoundError: org/apache/flink/streaming/api/scala/StreamExecutionEnvironment第一个Exception NoClassDefFoundError: org/apache/flink/streaming/api/environment/StreamExecutionEnvironment 可以解决如java.lang.NoClassDefFoundError: org/apache/flink/streaming/api/scala/StreamExecutionEnvironment

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/flink/streaming/api/environment/StreamExecutionEnvironment
    at com.example.flink.StreamingJob.main(StreamingJob.java:39)
Caused by: java.lang.ClassNotFoundException: org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 1 more

But then I get Exception in thread "main" java.lang.RuntimeException: No data sinks have been created yet.但后来我Exception in thread "main" java.lang.RuntimeException: No data sinks have been created yet.

PS All links to documentation https://flink.apache.org/docs/latest from these 2 Java classes are 404 Not Found, PS 所有链接到文档https://flink.apache.org/docs/latest从这 2 Java 类是 404 未找到,
so I guess this maven archetype was in fact abandoned and not updated for some time.所以我猜这个 maven 原型实际上已经被放弃并且有一段时间没有更新了。

         * Have a look at the programming guide for the Java API:
         *
         * https://flink.apache.org/docs/latest/apis/batch/index.html
         *
         * and the examples
         *
         * https://flink.apache.org/docs/latest/apis/batch/examples.html

The maven quickstart does provide a properly setup skeleton project. maven 快速入门确实提供了正确设置的框架项目。 However, the supplied applications aren't complete and don't run out of the box because they lack sources and sinks.但是,所提供的应用程序并不完整,也不会开箱即用,因为它们缺少源和接收器。

If you define a simple pipeline such as如果您定义一个简单的管道,例如

env.fromElements(1, 2, 3).print();

then they will work.然后他们就会工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 线程“main”中的异常 java.lang.RuntimeException:尚未实现 - Exception in thread "main" java.lang.RuntimeException: Not yet implemented Java错误:线程“ main”中的异常java.lang.RuntimeException - Java Errors: Exception in thread “main” java.lang.RuntimeException 线程“main”中的异常 java.lang.RuntimeException: Stub XmlPullParserFactory - Exception in thread "main" java.lang.RuntimeException: Stub XmlPullParserFactory 线程“主”java.lang.RuntimeException 中的异常:矩阵是奇异的 - Exception in thread “main” java.lang.RuntimeException: Matrix is singular 线程“ main”中的异常java.lang.RuntimeException:无法编译的源代码 - Exception in thread “main” java.lang.RuntimeException: Uncompilable source code 线程“main”中的异常java.lang.RuntimeException:找不到OpenGL上下文 - Exception in thread “main” java.lang.RuntimeException: No OpenGL context found 线程“main”中的异常java.lang.RuntimeException:Stub - Exception in thread “main” java.lang.RuntimeException: Stub 线程“主”java.lang.RuntimeException 中的错误异常 - Error Exception in thread "main" java.lang.RuntimeException 致命异常:主java.lang.RuntimeException: - FATAL EXCEPTION: Main java.lang.RuntimeException: 由 java.lang.RuntimeException 引起的线程“main”java.lang.ExceptionInInitializerError 中的异常:无法实例 KieServices - Exception in thread "main" java.lang.ExceptionInInitializerError caused by java.lang.RuntimeException: Unable to instance KieServices
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM