apache/seatunnel · error · FactoryException
Could not find any factories that implement '%s' in the clas
Error message
Could not find any factories that implement '%s' in the classpath.
What it means
FactoryUtil.discoverFactory throws this FactoryException when the ServiceLoader found no factories at all implementing the requested factory class (e.g. TableSourceFactory) on the classpath. This fires before identifier matching, so it means the entire factory SPI failed to load, not just the requested plugin.
Source
Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/table/factory/FactoryUtil.java:345
return Optional.empty();
}
final List<T> matchingFactories =
foundFactories.stream()
.filter(f -> f.factoryIdentifier().equalsIgnoreCase(factoryIdentifier))
.collect(Collectors.toList());
if (matchingFactories.isEmpty()) {
return Optional.empty();
}
checkMultipleMatchingFactories(factoryIdentifier, factoryClass, matchingFactories);
return Optional.of(matchingFactories.get(0));
}
public static <T extends Factory> T discoverFactory(
ClassLoader classLoader, Class<T> factoryClass, String factoryIdentifier) {
final List<T> foundFactories = discoverFactories(classLoader, factoryClass);
if (foundFactories.isEmpty()) {
throw new FactoryException(
String.format(
"Could not find any factories that implement '%s' in the classpath.",
factoryClass.getName()));
}
final List<T> matchingFactories =
foundFactories.stream()
.filter(f -> f.factoryIdentifier().equalsIgnoreCase(factoryIdentifier))
.collect(Collectors.toList());
if (matchingFactories.isEmpty()) {
throw new FactoryException(
String.format(
"Could not find any factory for identifier '%s' that implements '%s' in the classpath.\n\n"
+ "Available factory identifiers are:\n\n"
+ "%s",
factoryIdentifier,
factoryClass.getName(),View on GitHub (pinned to cf67b549a7)
Solutions
- Install the SeaTunnel connectors: sh bin/install-plugin.sh <version>.
- Verify META-INF/services/org.apache.seatunnel.api.table.factory.Factory exists inside the connector jar.
- Check the classloader passed to discoverFactory actually includes the connector jars.
- If building a shaded jar, ensure SPI files are not filtered out by the shade plugin.
Example fix
// before (custom classloader with only app jars)
URLClassLoader cl = new URLClassLoader(new URL[]{appJar});
// after
URLClassLoader cl = new URLClassLoader(new URL[]{appJar, connectorJar}, FactoryUtil.class.getClassLoader()); Defensive patterns
Strategy: validation
Validate before calling
List<Factory> all = FactoryUtil.discoverFactories(classLoader);
if (all.isEmpty()) {
throw new IllegalStateException("No SeaTunnel factories on classpath; install connectors first");
} Try / catch
try {
TableSourceFactory f = FactoryUtil.discoverFactory(cl, TableSourceFactory.class, id);
} catch (FactoryException e) {
throw new IllegalStateException("Connector jars missing from classpath — run install-plugin.sh", e);
} Prevention
- Run sh bin/install-plugin.sh after installing SeaTunnel.
- When building custom fat jars, keep META-INF/services files unfiltered.
- Verify the SPI file name is exactly org.apache.seatunnel.api.table.factory.Factory.
When it happens
Trigger: Calling discoverFactory(classLoader, TableSourceFactory.class, id) when discoverFactories() returns an empty list — no META-INF/services/org.apache.seatunnel.api.table.factory.Factory resources visible to the classloader.
Common situations: Connector jars not installed in the plugins/connectors directory; fat jar missing SPI service files after shading; custom classloader that excludes SeaTunnel service files; running from an IDE without connector modules on the classpath.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Multiple factories for identifier '%s' that implement '%s' f
- Could not load service provider for factories.
- Could not load service provider for factories.
- No data type converter found for identifier: ${identifier}
- No data converter found for identifier: ${identifier}
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/1deaae6355e58394.
Report an issue: GitHub.