apache/seatunnel · warning

Failed to load JDBC driver {}

Error message

Failed to load JDBC driver {}

What it means

The JdbcSource constructor attempts Class.forName(driverName) to register the JDBC driver with DriverManager. If the driver class cannot be loaded (missing jar), the source logs this warning instead of failing, allowing drivers that register themselves via SPI (META-INF/services/java.sql.Driver) to still work.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSource.java:59

import java.util.Map;
import java.util.stream.Collectors;

public class JdbcSource
        implements SeaTunnelSource<SeaTunnelRow, JdbcSourceSplit, JdbcSourceState>,
                SupportParallelism,
                SupportColumnProjection {
    protected static final Logger LOG = LoggerFactory.getLogger(JdbcSource.class);

    private final JdbcSourceConfig jdbcSourceConfig;
    private final Map<TablePath, JdbcSourceTable> jdbcSourceTables;

    @SneakyThrows
    public JdbcSource(JdbcSourceConfig jdbcSourceConfig) {
        // Load the JDBC driver in to DriverManager
        try {
            Class.forName(jdbcSourceConfig.getJdbcConnectionConfig().getDriverName());
        } catch (Exception e) {
            LOG.warn(
                    "Failed to load JDBC driver {}",
                    jdbcSourceConfig.getJdbcConnectionConfig().getDriverName(),
                    e);
        }
        this.jdbcSourceConfig = jdbcSourceConfig;
        this.jdbcSourceTables =
                JdbcCatalogUtils.getTables(
                        jdbcSourceConfig.getJdbcConnectionConfig(),
                        jdbcSourceConfig.getTableConfigList(),
                        jdbcSourceConfig.getMultiTableFailurePolicy());
    }

    @Override
    public String getPluginName() {
        return "Jdbc";
    }

    @Override

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Install/copy the JDBC driver jar into $SEATUNNEL_HOME/connectors (or use sh bin/install-plugin.sh) so the driver class is on the classpath.
  2. Verify the driver name in source config (e.g. com.mysql.cj.jdbc.Driver) matches the class actually present in the jar.
  3. If the driver relies on SPI and the connection works, this warning can be ignored.
  4. Rebuild the job with the driver bundled if running in a fat-jar / cluster deployment.

Example fix

// before
url = "jdbc:mysql://localhost:3306/db"
driver = "com.mysql.cj.jdbc.Driver" // jar missing
// after
# copy mysql-connector-java-8.0.x.jar to $SEATUNNEL_HOME/connectors/connector-jdbc/lib or run install-plugin.sh
url = "jdbc:mysql://localhost:3306/db"
driver = "com.mysql.cj.jdbc.Driver"
Defensive patterns

Strategy: validation

Validate before calling

try {
    Class.forName("com.mysql.cj.jdbc.Driver");
} catch (ClassNotFoundException e) {
    throw new IllegalStateException("Driver jar missing from classpath: copy it to $SEATUNNEL_HOME/connectors");
}

Prevention

When it happens

Trigger: JdbcSource is instantiated with a JdbcSourceConfig whose jdbc driver name class is not on the classpath (driver jar absent from $SEATUNNEL_HOME/plugins or lib directories).

Common situations: Forgetting to run install-plugin.sh or copy the vendor driver jar (mysql-connector, postgresql, ojdbc, etc.) into the connector directory; driver name typo in url config; fat-jar missing driver.

Related errors


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