{"record":{"id":"bef5182cb9ee9325","repo":"apache/seatunnel","slug":"seatunnelapierrorcode-config-validation-failed-bef518","errorCode":"SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED","errorMessage":"PluginName: %s, PluginType: %s, Message: %s","messagePattern":"PluginName: (.+?), PluginType: (.+?), Message: (.+?)","errorType":"error_code","errorClass":"org.apache.seatunnel.connectors.seatunnel.maxcompute.exception.MaxcomputeConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/sink/MaxcomputeSink.java","lineNumber":72,"sourceCode":"    @Override\n    public String getPluginName() {\n        return MaxcomputeSinkOptions.PLUGIN_NAME;\n    }\n\n    @Override\n    public MaxcomputeWriter createWriter(SinkWriter.Context context) {\n        return new MaxcomputeWriter(this.readonlyConfig, this.catalogTable.getSeaTunnelRowType());\n    }\n\n    @Override\n    public Optional<SaveModeHandler> getSaveModeHandler() {\n        CatalogFactory catalogFactory =\n                discoverFactory(\n                        Thread.currentThread().getContextClassLoader(),\n                        CatalogFactory.class,\n                        MaxcomputeSinkOptions.PLUGIN_NAME);\n        if (catalogFactory == null) {\n            throw new MaxcomputeConnectorException(\n                    SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,\n                    String.format(\n                            \"PluginName: %s, PluginType: %s, Message: %s\",\n                            getPluginName(),\n                            PluginType.SINK,\n                            \"Cannot find MaxCompute catalog factory\"));\n        }\n        MaxComputeCatalog catalog =\n                (MaxComputeCatalog)\n                        catalogFactory.createCatalog(\n                                catalogFactory.factoryIdentifier(), readonlyConfig);\n\n        DataSaveMode dataSaveMode = readonlyConfig.get(MaxcomputeSinkOptions.DATA_SAVE_MODE);\n        if (readonlyConfig.get(MaxcomputeSinkOptions.OVERWRITE)) {\n            // compatible with old version\n            LOG.warn(\n                    \"The configuration of 'overwrite' is deprecated, please use 'data_save_mode' instead.\");\n            dataSaveMode = DataSaveMode.DROP_DATA;","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/sink/MaxcomputeSink.java#L54-L90","documentation":"MaxcomputeSink.getSaveModeHandler resolves the MaxCompute CatalogFactory via SPI to build a save-mode handler. If the factory cannot be discovered on the thread context classloader, it throws MaxcomputeConnectorException with CONFIG_VALIDATION_FAILED, formatted as 'PluginName: ..., PluginType: SINK, Message: Cannot find MaxCompute catalog factory'.","triggerScenarios":"The connector-maxcompute plugin jar is missing from the SeaTunnel plugin directory, or the SPI service file for CatalogFactory is not on the classloader used at sink initialization when save_mode is enabled.","commonSituations":"Running a job where the sink jar was manually copied but the catalog SPI registration/dependencies were not; using a shaded/fat jar that excluded the META-INF/services entry; plugin install directory misconfigured (connector jar not installed via install-plugin.sh).","solutions":["Install the connector-maxcompute artifact properly (sh bin/install-plugin.sh) so jar + SPI files land in the plugins dir","Verify META-INF/services/org.apache.seatunnel.api.table.catalog.spi.CatalogFactory exists inside the connector jar","Ensure Thread.currentThread().getContextClassLoader can see the connector classes (check --set-thread-context-classloader / plugin layout)","Add connector-maxcompute as a dependency if embedding SeaTunnel API in a custom app"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"CatalogFactory f = discoverFactory(cl, CatalogFactory.class, MaxcomputeSinkOptions.PLUGIN_NAME);\nif (f == null) throw new IllegalStateException(\"connector-maxcompute jar/SPI missing from classpath\");","typeGuard":null,"tryCatchPattern":"try { return getSaveModeHandler(); }\ncatch (MaxcomputeConnectorException e) {\n    throw new IllegalStateException(\"MaxCompute catalog factory missing — install connector-maxcompute plugin\", e);\n}","preventionTips":["Run sh bin/install-plugin.sh to install the connector","Verify META-INF/services CatalogFactory entry inside the jar","Avoid fat jars that drop SPI service files","Use save_mode only when the catalog plugin is deployed"],"tags":["maxcompute","spi","classpath","plugin-not-found"],"backgroundTag":"missing-dependency","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}