Flink1.11 解决 No ExecutorFactory found to execute the application
在使用Flink1.11的时候写了个本地Test 运行的时候发现报错了,具体如下
Exception in thread "main" java.lang.IllegalStateException: No ExecutorFactory found to execute the application.
at org.apache.flink.core.execution.DefaultExecutorServiceLoader.getExecutorFactory(DefaultExecutorServiceLoader.java:84)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.executeAsync(StreamExecutionEnvironment.java:1801)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1711)
at org.apache.flink.streaming.api.environment.LocalStreamEnvironment.execute(LocalStreamEnvironment.java:74)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1697)
at com.bigdata.testKafkaUpsert.main(testKafkaUpsert.java:54)
查看Flink1.11 release文档发现
Reversed dependency from flink-streaming-java to flink-client (FLINK-15090) Starting from Flink 1.11.0, the flink-streaming-java module does not have a dependency on flink-clients anymore.
If your project was depending on this transitive dependency you now have to add flink-clients as an explicit dependency.
从Flink 1.11.0 开始flink-streaming-java不再依赖flink-client需要单独引用,那么增加相应依赖即可解决
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-clients_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency>
参考文档
https://ci.apache.org/projects/flink/flink-docs-stable/release-notes/flink-1.11.html#reversed-dependency-from-flink-streaming-java-to-flink-client-flink-15090