apache/seatunnel · error · org.apache.seatunnel.connectors.seatunnel.maxcompute.exception.MaxcomputeConnectorException

SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED

SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED

Error message

PluginName: %s, PluginType: %s, Message: %s

What it means

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'.

Source

Thrown at seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/sink/MaxcomputeSink.java:72

    @Override
    public String getPluginName() {
        return MaxcomputeSinkOptions.PLUGIN_NAME;
    }

    @Override
    public MaxcomputeWriter createWriter(SinkWriter.Context context) {
        return new MaxcomputeWriter(this.readonlyConfig, this.catalogTable.getSeaTunnelRowType());
    }

    @Override
    public Optional<SaveModeHandler> getSaveModeHandler() {
        CatalogFactory catalogFactory =
                discoverFactory(
                        Thread.currentThread().getContextClassLoader(),
                        CatalogFactory.class,
                        MaxcomputeSinkOptions.PLUGIN_NAME);
        if (catalogFactory == null) {
            throw new MaxcomputeConnectorException(
                    SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,
                    String.format(
                            "PluginName: %s, PluginType: %s, Message: %s",
                            getPluginName(),
                            PluginType.SINK,
                            "Cannot find MaxCompute catalog factory"));
        }
        MaxComputeCatalog catalog =
                (MaxComputeCatalog)
                        catalogFactory.createCatalog(
                                catalogFactory.factoryIdentifier(), readonlyConfig);

        DataSaveMode dataSaveMode = readonlyConfig.get(MaxcomputeSinkOptions.DATA_SAVE_MODE);
        if (readonlyConfig.get(MaxcomputeSinkOptions.OVERWRITE)) {
            // compatible with old version
            LOG.warn(
                    "The configuration of 'overwrite' is deprecated, please use 'data_save_mode' instead.");
            dataSaveMode = DataSaveMode.DROP_DATA;

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Install the connector-maxcompute artifact properly (sh bin/install-plugin.sh) so jar + SPI files land in the plugins dir
  2. Verify META-INF/services/org.apache.seatunnel.api.table.catalog.spi.CatalogFactory exists inside the connector jar
  3. Ensure Thread.currentThread().getContextClassLoader can see the connector classes (check --set-thread-context-classloader / plugin layout)
  4. Add connector-maxcompute as a dependency if embedding SeaTunnel API in a custom app
Defensive patterns

Strategy: validation

Validate before calling

CatalogFactory f = discoverFactory(cl, CatalogFactory.class, MaxcomputeSinkOptions.PLUGIN_NAME);
if (f == null) throw new IllegalStateException("connector-maxcompute jar/SPI missing from classpath");

Try / catch

try { return getSaveModeHandler(); }
catch (MaxcomputeConnectorException e) {
    throw new IllegalStateException("MaxCompute catalog factory missing — install connector-maxcompute plugin", e);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


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