No ExecutorFactory found to execute the application.
Exception in thread "main" java.lang.IllegalStateException: No ExecutorFactory found to execute the application.
at org.apache.flink.core.execution.DefaultExecutorServiceLoader.getExecutorFactory(DefaultExecutorServiceLoader.java:88)
at org.apache.flink.api.java.ExecutionEnvironment.executeAsync(ExecutionEnvironment.java:1043)
at org.apache.flink.api.java.ExecutionEnvironment.execute(ExecutionEnvironment.java:958)
at org.apache.flink.api.java.ExecutionEnvironment.execute(ExecutionEnvironment.java:942)
at org.apache.flink.api.java.DataSet.collect(DataSet.java:417)
at org.apache.flink.api.java.DataSet.print(DataSet.java:1748)
版本问题。笔者用的是1.12版本,需要flink-clients客户端依赖。
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-clients_2.12</artifactId>
<version>1.12.1</version>
</dependency>
No new data sinks have been defined since the last execution.
Exception in thread “main” java.lang.RuntimeException: No new data sinks have been defined since the last execution. The last execution refers to the latest call to ‘execute()’, ‘count()’, ‘collect()’, or ‘print()’.
at org.apache.flink.api.java.ExecutionEnvironment.createProgramPlan(ExecutionEnvironment.java:1165)
解决方法:Flink批处理任务注释掉env.execute()即可
java.lang.NoClassDefFoundError: org/apache/flink/api/common/functions/FlatMapFunction
错误: 无法初始化主类 com.awecoder.flink.basic.StreamWordCount
原因: java.lang.NoClassDefFoundError: org/apache/flink/api/common/functions/FlatMapFunction
去掉依赖中provided。
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.flink.api.java.ClosureCleaner (file:/D:/Program%20Files/apache-maven-3.5.4/repo/org/apache/flink/flink-core/1.12.7/flink-core-1.12.7.jar) to field java.lang.String.value
WARNING: Please consider reporting this to the maintainers of org.apache.flink.api.java.ClosureCleaner
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
可能是JDK版本过高,用了11,换成8即可。