{"record":{"id":"8f451474bca95a33","repo":"apache/seatunnel","slug":"failed-to-load-jdbc-driver-8f4514","errorCode":null,"errorMessage":"Failed to load JDBC driver {}","messagePattern":"Failed to load JDBC driver (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSource.java","lineNumber":59,"sourceCode":"import java.util.Map;\nimport java.util.stream.Collectors;\n\npublic class JdbcSource\n        implements SeaTunnelSource<SeaTunnelRow, JdbcSourceSplit, JdbcSourceState>,\n                SupportParallelism,\n                SupportColumnProjection {\n    protected static final Logger LOG = LoggerFactory.getLogger(JdbcSource.class);\n\n    private final JdbcSourceConfig jdbcSourceConfig;\n    private final Map<TablePath, JdbcSourceTable> jdbcSourceTables;\n\n    @SneakyThrows\n    public JdbcSource(JdbcSourceConfig jdbcSourceConfig) {\n        // Load the JDBC driver in to DriverManager\n        try {\n            Class.forName(jdbcSourceConfig.getJdbcConnectionConfig().getDriverName());\n        } catch (Exception e) {\n            LOG.warn(\n                    \"Failed to load JDBC driver {}\",\n                    jdbcSourceConfig.getJdbcConnectionConfig().getDriverName(),\n                    e);\n        }\n        this.jdbcSourceConfig = jdbcSourceConfig;\n        this.jdbcSourceTables =\n                JdbcCatalogUtils.getTables(\n                        jdbcSourceConfig.getJdbcConnectionConfig(),\n                        jdbcSourceConfig.getTableConfigList(),\n                        jdbcSourceConfig.getMultiTableFailurePolicy());\n    }\n\n    @Override\n    public String getPluginName() {\n        return \"Jdbc\";\n    }\n\n    @Override","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSource.java#L41-L77","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["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.","Verify the driver name in source config (e.g. com.mysql.cj.jdbc.Driver) matches the class actually present in the jar.","If the driver relies on SPI and the connection works, this warning can be ignored.","Rebuild the job with the driver bundled if running in a fat-jar / cluster deployment."],"exampleFix":"// before\nurl = \"jdbc:mysql://localhost:3306/db\"\ndriver = \"com.mysql.cj.jdbc.Driver\" // jar missing\n// after\n# copy mysql-connector-java-8.0.x.jar to $SEATUNNEL_HOME/connectors/connector-jdbc/lib or run install-plugin.sh\nurl = \"jdbc:mysql://localhost:3306/db\"\ndriver = \"com.mysql.cj.jdbc.Driver\"","handlingStrategy":"validation","validationCode":"try {\n    Class.forName(\"com.mysql.cj.jdbc.Driver\");\n} catch (ClassNotFoundException e) {\n    throw new IllegalStateException(\"Driver jar missing from classpath: copy it to $SEATUNNEL_HOME/connectors\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run install-plugin.sh or manually copy the vendor driver jar","Verify driver class name matches the jar version","Smoke-test the connection before submitting production jobs"],"tags":["jdbc","classpath","driver-loading","dependency"],"backgroundTag":"class-not-found","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}