Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

upgraded flink from 1.10 to 1.11, met error 'No ExecutorFactory found to execute the application'

Tags:

apache-flink

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:1803)
    at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1713)
    at org.apache.flink.streaming.api.environment.LocalStreamEnvironment.execute(LocalStreamEnvironment.java:74)
    at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1699)
    at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1681)
    at com.cep.StaticAlarmGenerationEntryTest.main(StaticAlarmGenerationEntryTest.java:149)

The error I met after I upgraded FLink from 1.10 to 1.11, and my IDE is eclipse. and I tried to add artifactId:flink-clients_${scala.binary.version}, but still failed. Anybody already met and solved this issue, pls tell me. thanks a lot.

like image 681
Gene Avatar asked Jul 22 '20 10:07

Gene


3 Answers

See the 1.11 release note, where you now have to add an explicit dependency on flink-clients.

like image 197
kkrugler Avatar answered Nov 05 '22 16:11

kkrugler


I have solved my problem this way :

1.Use Java 8, apparently Flink has some sort of problem with Java 11 or 15

2.Change all the Scopes to "compile" you can change scopes in this path : Project Structure → Modules → Dependencies → There is a table that one of its column's name is Scope

enter image description here

like image 21
Keipro Avatar answered Nov 05 '22 18:11

Keipro


I found the reason why the error happened event I add dependency flink-clients. I upgraded Flink from 1.10 to 1.11, just edited the version of Flink, but not changed Scala version. Here also should change Scala version to 2.12. And the project is generated base on 1.10 archetype and Scala version is 2.11. Every time I build the project, it use the 2.11 environments. So the fast way to solve this issue is :

  1. use mvn archetype:generate -DarchetypeGroupId=org.apache.flink -DarchetypeArtifactId=flink-quickstart-java -DarchetypeVersion=1.11.0 this command to generate new project.
  2. copy all your old code to this new project. You will find that the flink-clinets already added in the pom.xml.
like image 1
Gene Avatar answered Nov 05 '22 16:11

Gene