{"record":{"id":"a5484d0d206c3bc5","repo":"apache/seatunnel","slug":"the-factory-has-not-been-implemented-and-the-depre","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/TableSinkFactory.java","lineNumber":44,"sourceCode":" * This is an SPI interface, used to create {@link TableSink}. Each plugin need to have it own\n * implementation.\n *\n * @param <IN> row type\n * @param <StateT> state type\n * @param <CommitInfoT> commit info type\n * @param <AggregatedCommitInfoT> aggregated commit info type\n */\npublic interface TableSinkFactory<IN, StateT, CommitInfoT, AggregatedCommitInfoT> 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     * @return return the sink created by this factory\n     */\n    default TableSink<IN, StateT, CommitInfoT, AggregatedCommitInfoT> createSink(\n            TableSinkFactoryContext context) {\n        throw new UnsupportedOperationException(\n                \"The Factory has not been implemented and the deprecated Plugin will be used.\");\n    }\n\n    @Deprecated\n    default List<String> excludeTablePlaceholderReplaceKeys() {\n        return Collections.emptyList();\n    }\n}\n","sourceCodeStart":26,"sourceCodeEnd":53,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/factory/TableSinkFactory.java#L26-L53","documentation":"Default implementation of TableSinkFactory.createSink throws UnsupportedOperationException to signal that the factory has not implemented the new Factory API. In that case the framework falls back to the deprecated legacy Plugin (SeaTunnelSink) discovery path. Hitting the raw exception directly means the fallback was bypassed or the factory is expected to implement this method.","triggerScenarios":"Calling a sink factory's createSink(context) when the concrete TableSinkFactory only implemented the deprecated plugin interfaces and not the new default method, and caller code invokes createSink directly (or a code path that does not perform legacy fallback).","commonSituations":"Custom sink plugins written against the old deprecated Plugin API that were never migrated to TableSinkFactory; using a connector version where the new factory method is missing; reflection or framework code calling the interface default instead of the deprecated path.","solutions":["Implement createSink(TableSinkFactoryContext) in your sink factory, returning a TableSink built from the context.","If relying on the framework, ensure the discovery path falls back to the deprecated plugin instead of calling createSink directly.","Migrate the connector fully off the deprecated Plugin API.","Check whether the connector version in use actually supports the new factory API; upgrade if not."],"exampleFix":"// before\npublic class MySinkFactory implements TableSinkFactory { /* only deprecated Plugin */ }\n// after\npublic class MySinkFactory implements TableSinkFactory {\n    @Override\n    public <IN, StateT, CommitInfoT, AggregatedCommitInfoT> TableSink<IN, StateT, CommitInfoT, AggregatedCommitInfoT> createSink(TableSinkFactoryContext context) {\n        return new MyTableSink<>(context);\n    }\n}","handlingStrategy":"fallback","validationCode":"if (factory.getClass().getEnclosingClass() == null) { try { factory.getClass().getMethod(\"createSink\", TableSinkFactoryContext.class); } catch (NoSuchMethodException e) { /* default method; use legacy plugin path */ } }","typeGuard":null,"tryCatchPattern":"try { return factory.createSink(context); } catch (UnsupportedOperationException e) { return createSinkFromDeprecatedPlugin(context); }","preventionTips":["Implement the Factory API methods in custom sinks","Keep connector versions aligned with the engine","Prefer framework discovery entry points over direct factory calls"],"tags":["factory","sink","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"}