apache/flink · critical · IllegalStateException
No ExecutorFactory found to execute the application.
Error message
No ExecutorFactory found to execute the application.
What it means
Thrown by DefaultExecutorServiceLoader.getExecutorFactory when no PipelineExecutorFactory is compatible with the given configuration. The ServiceLoader found zero factories whose isCompatibleWith returned true (or no factories are registered at all).
Source
Thrown at flink-core/src/main/java/org/apache/flink/core/execution/DefaultExecutorServiceLoader.java:88
LOG.info("Could not load factory due to missing dependencies.");
} else {
throw e;
}
}
}
if (compatibleFactories.size() > 1) {
final String configStr =
configuration.toMap().entrySet().stream()
.map(e -> e.getKey() + "=" + e.getValue())
.collect(Collectors.joining("\n"));
throw new IllegalStateException(
"Multiple compatible client factories found for:\n" + configStr + ".");
}
if (compatibleFactories.isEmpty()) {
throw new IllegalStateException("No ExecutorFactory found to execute the application.");
}
return compatibleFactories.get(0);
}
@Override
public Stream<String> getExecutorNames() {
final ServiceLoader<PipelineExecutorFactory> loader =
ServiceLoader.load(PipelineExecutorFactory.class);
return StreamSupport.stream(loader.spliterator(), false)
.map(PipelineExecutorFactory::getName);
}
}
View on GitHub (pinned to 2f3c205e92)
Solutions
- Ensure the appropriate executor JAR (flink-clients, flink-yarn, flink-kubernetes) is on the classpath.
- Set a valid execution.target (local, remote, yarn-application, yarn-session, kubernetes-application, kubernetes-session).
- If shading, preserve META-INF/services/org.apache.flink.core.execution.PipelineExecutorFactory.
- Verify the SPI service file exists in the JAR.
Example fix
# before execution.target: yarn-app # typo # after execution.target: yarn-application
Defensive patterns
Strategy: validation
Validate before calling
// Verify an executor factory is registered via SPI
java.util.ServiceLoader<PipelineExecutorFactory> sl =
java.util.ServiceLoader.load(PipelineExecutorFactory.class);
if (!sl.iterator().hasNext()) {
throw new IllegalStateException("No PipelineExecutorFactory registered");
} Try / catch
try {
loader.getExecutorFactory(configuration);
} catch (IllegalStateException e) {
if (e.getMessage().equals("No ExecutorFactory found to execute the application.")) { /* add JAR / fix target */ }
} Prevention
- Ensure the correct executor JAR (clients, yarn, kubernetes) is on the classpath.
- Use a valid execution.target value.
- Preserve META-INF/services entries when shading.
When it happens
Trigger: No executor implementation JAR on the classpath (missing flink-clients or deployment-specific module). An execution.target or deployment configuration that no registered factory recognizes. SPI service file missing or misconfigured.
Common situations: Running a minimal Flink distribution without the clients module. Setting execution.target to an unsupported/typo value (e.g., 'yarn-app'). Shading that drops META-INF/services entries. Missing the deployment connector (yarn/k8s) JAR.
Related errors
- Multiple compatible client factories found for: {}.
- No ClusterClientFactory found. If you were targeting a Yarn
- Multiple compatible client factories found for: {}.
- Class '%s' not found. Perhaps you forgot to add the module '
- JAR file does not exist '{}'
AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14).
Data as JSON: /api/errors/a2647212894a7af6.
Report an issue: GitHub.