apache/seatunnel · warning

Failed to load JDBC driver {}

Error message

Failed to load JDBC driver {}

What it means

JdbcSinkWriter.initMultiTableResourceManager() creates the Hikari connection pool and first loads the JDBC driver via Class.forName(driverName). Load failure is WARN-logged, not thrown; the pool is still configured and later connection creation will fail with 'No suitable driver'.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/sink/JdbcSinkWriter.java:138

                                connectionProvider,
                                jdbcSinkConfig,
                                tableSchema,
                                databaseTableSchema)
                        .build();
        configureOutputFormatForRowErrorHandling();
        if (context != null) {
            context.registerFlushAction(this::timerFlush);
        }
    }

    @Override
    public MultiTableResourceManager<ConnectionPoolManager> initMultiTableResourceManager(
            int tableSize, int queueSize) {
        HikariDataSource ds = new HikariDataSource();
        try {
            Class.forName(jdbcSinkConfig.getJdbcConnectionConfig().getDriverName());
        } catch (Exception e) {
            log.warn(
                    "Failed to load JDBC driver {}",
                    jdbcSinkConfig.getJdbcConnectionConfig().getDriverName(),
                    e);
        }
        ds.setIdleTimeout(30 * 1000);
        ds.setMaximumPoolSize(queueSize);
        ds.setJdbcUrl(jdbcSinkConfig.getJdbcConnectionConfig().getUrl());
        ds.setDriverClassName(jdbcSinkConfig.getJdbcConnectionConfig().getDriverName());
        if (jdbcSinkConfig.getJdbcConnectionConfig().getUsername().isPresent()) {
            ds.setUsername(jdbcSinkConfig.getJdbcConnectionConfig().getUsername().get());
        }
        if (jdbcSinkConfig.getJdbcConnectionConfig().getPassword().isPresent()) {
            ds.setPassword(jdbcSinkConfig.getJdbcConnectionConfig().getPassword().get());
        }
        ds.setAutoCommit(jdbcSinkConfig.getJdbcConnectionConfig().isAutoCommit());
        applyConnectionValidation(ds, jdbcSinkConfig.getJdbcConnectionConfig());
        jdbcSinkConfig.getJdbcConnectionConfig().getProperties().forEach(ds::addDataSourceProperty);
        return new JdbcMultiTableResourceManager(new ConnectionPoolManager(ds));

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Add the JDBC driver jar to the worker classpath
  2. Fix driver_name to the correct FQCN
  3. Verify the jar exists on all worker nodes, not just the client

Example fix

// before
driver_name = "com.microsoft.sqlserver.jdbc.SQLServerDriver" // jar missing
// after
# copy mssql-jdbc-*.jar to $SEATUNNEL_HOME/lib then restart workers
Defensive patterns

Strategy: validation

Validate before calling

// verify driver before opening pools
try {
    Class.forName(driverName);
} catch (ClassNotFoundException e) {
    throw new IllegalStateException("Driver missing: " + driverName);
}

Prevention

When it happens

Trigger: Writer initialization with multi-table resource manager while driver-name class is absent from the classpath (missing driver jar, wrong class name, shaded path issues).

Common situations: Driver jar not installed for the engine/worker nodes; typo in driver_name; using a driver compiled for an incompatible JDK.

Related errors


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