apache/seatunnel · error · FactoryException

Could not find any factory for identifier '%s' that implemen

Error message

Could not find any factory for identifier '%s' that implements '%s' in the classpath.

Available factory identifiers are:

%s

What it means

FactoryUtil.discoverFactory throws this FactoryException when factories implementing the requested class were found, but none matches the given factoryIdentifier (case-insensitive). The message lists all available identifiers so you can correct the name.

Source

Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/table/factory/FactoryUtil.java:357

    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(),
                            foundFactories.stream()
                                    .map(Factory::factoryIdentifier)
                                    .distinct()
                                    .sorted()
                                    .collect(Collectors.joining("\n"))));
        }

        checkMultipleMatchingFactories(factoryIdentifier, factoryClass, matchingFactories);

        return matchingFactories.get(0);
    }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Copy an identifier verbatim from the 'Available factory identifiers' list printed in the message.
  2. Install the connector plugin if its identifier is absent from the list.
  3. Check plugin-mapping.properties / docs for the current identifier after upgrading SeaTunnel.

Example fix

// before
sink { Jdbc-sink { ... } }
// after
sink { Jdbc { ... } } // identifier taken from the available-identifiers list
Defensive patterns

Strategy: validation

Validate before calling

boolean exists = FactoryUtil.discoverFactories(classLoader).stream()
    .anyMatch(f -> f.factoryIdentifier().equalsIgnoreCase(pluginId));
if (!exists) throw new IllegalArgumentException("Unknown plugin identifier: " + pluginId);

Try / catch

try {
    return FactoryUtil.discoverFactory(cl, TableSinkFactory.class, id);
} catch (FactoryException e) {
    System.err.println(e.getMessage()); // includes the available-identifier list to correct against
    throw e;
}

Prevention

When it happens

Trigger: Calling discoverFactory(classLoader, TableSinkFactory.class, 'MySql') when no discovered factory's factoryIdentifier() equals 'MySql' — a typo or a plugin that isn't installed.

Common situations: Typo in source/sink plugin name in the HOCON config; using an identifier from an old SeaTunnel version that was renamed; connector jar missing while others load fine.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/30b9e04480f56fa9. Report an issue: GitHub.