apache/seatunnel · error · UnsupportedOperationException

The Factory has not been implemented and the deprecated Plug

Error message

The Factory has not been implemented and the deprecated Plugin will be used.

What it means

Default implementation of TableSourceFactory.createSource throws UnsupportedOperationException when a source factory has not implemented the new Factory API, indicating the deprecated legacy Plugin path should be used instead. Encountering the exception directly means the factory lacks the new method and the caller bypassed the legacy fallback.

Source

Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/table/factory/TableSourceFactory.java:42

import org.apache.seatunnel.api.table.connector.TableSource;

import java.io.Serializable;
import java.util.List;

/**
 * This is an SPI interface, used to create {@link TableSource}. Each plugin need to have it own
 * implementation.
 */
public interface TableSourceFactory extends Factory {

    /**
     * We will never use this method now. So gave a default implement and return null.
     *
     * @param context TableFactoryContext
     */
    default <T, SplitT extends SourceSplit, StateT extends Serializable>
            TableSource<T, SplitT, StateT> createSource(TableSourceFactoryContext context) {
        throw new UnsupportedOperationException(
                "The Factory has not been implemented and the deprecated Plugin will be used.");
    }

    /**
     * We can get the catalogTable list in the source configuration through this method
     *
     * @param context TableFactoryContext
     */
    default List<CatalogTable> discoverTableSchemas(TableSourceFactoryContext context) {
        try (TableSchemaDiscoverer metaLakeSchemaDiscoverer =
                new TableSchemaDiscoverer(context, factoryIdentifier())) {
            return metaLakeSchemaDiscoverer.discoverTableSchemas();
        }
    }

    /**
     * TODO: Implement SupportParallelism in the TableSourceFactory instead of the SeaTunnelSource,
     * Then deprecated the method

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Implement createSource(TableSourceFactoryContext) in the source factory.
  2. Ensure the discovery code path falls back to the deprecated plugin discovery when the default method would throw.
  3. Migrate the connector to the TableSourceFactory API.
  4. Upgrade the connector to a version that implements the new factory method.

Example fix

// before
public class MySourceFactory implements TableSourceFactory { /* legacy only */ }
// after
public class MySourceFactory implements TableSourceFactory {
    @Override
    public <T, SplitT extends SourceSplit, StateT extends Serializable> TableSource<T, SplitT, StateT> createSource(TableSourceFactoryContext context) {
        return new MyTableSource<>(context);
    }
}
Defensive patterns

Strategy: fallback

Try / catch

try { return factory.createSource(context); } catch (UnsupportedOperationException e) { return createSourceFromDeprecatedPlugin(context); }

Prevention

When it happens

Trigger: Invoking createSource(TableSourceFactoryContext) on a source factory that only implements the deprecated Plugin/SourcePlugin interfaces; framework or custom code resolving sources without going through the fallback-aware discovery path.

Common situations: Custom source connectors not yet migrated from the deprecated API; connector versions predating the Factory API being loaded by newer framework code; calling factory methods directly in tests or tooling.

Related errors


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