{"record":{"id":"807a92c90dee09dc","repo":"apache/seatunnel","slug":"the-factory-has-not-been-implemented-and-the-depre-807a92","errorCode":null,"errorMessage":"The Factory has not been implemented and the deprecated Plugin will be used.","messagePattern":"The Factory has not been implemented and the deprecated Plugin will be used\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/table/factory/TableSourceFactory.java","lineNumber":42,"sourceCode":"import org.apache.seatunnel.api.table.connector.TableSource;\n\nimport java.io.Serializable;\nimport java.util.List;\n\n/**\n * This is an SPI interface, used to create {@link TableSource}. Each plugin need to have it own\n * implementation.\n */\npublic interface TableSourceFactory extends Factory {\n\n    /**\n     * We will never use this method now. So gave a default implement and return null.\n     *\n     * @param context TableFactoryContext\n     */\n    default <T, SplitT extends SourceSplit, StateT extends Serializable>\n            TableSource<T, SplitT, StateT> createSource(TableSourceFactoryContext context) {\n        throw new UnsupportedOperationException(\n                \"The Factory has not been implemented and the deprecated Plugin will be used.\");\n    }\n\n    /**\n     * We can get the catalogTable list in the source configuration through this method\n     *\n     * @param context TableFactoryContext\n     */\n    default List<CatalogTable> discoverTableSchemas(TableSourceFactoryContext context) {\n        try (TableSchemaDiscoverer metaLakeSchemaDiscoverer =\n                new TableSchemaDiscoverer(context, factoryIdentifier())) {\n            return metaLakeSchemaDiscoverer.discoverTableSchemas();\n        }\n    }\n\n    /**\n     * TODO: Implement SupportParallelism in the TableSourceFactory instead of the SeaTunnelSource,\n     * Then deprecated the method","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/factory/TableSourceFactory.java#L24-L60","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Implement createSource(TableSourceFactoryContext) in the source factory.","Ensure the discovery code path falls back to the deprecated plugin discovery when the default method would throw.","Migrate the connector to the TableSourceFactory API.","Upgrade the connector to a version that implements the new factory method."],"exampleFix":"// before\npublic class MySourceFactory implements TableSourceFactory { /* legacy only */ }\n// after\npublic class MySourceFactory implements TableSourceFactory {\n    @Override\n    public <T, SplitT extends SourceSplit, StateT extends Serializable> TableSource<T, SplitT, StateT> createSource(TableSourceFactoryContext context) {\n        return new MyTableSource<>(context);\n    }\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { return factory.createSource(context); } catch (UnsupportedOperationException e) { return createSourceFromDeprecatedPlugin(context); }","preventionTips":["Implement createSource in custom source factories","Migrate off deprecated Plugin APIs","Test factory resolution in plugin CI"],"tags":["factory","source","deprecated-api","spi"],"backgroundTag":"method-not-implemented","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}