apache/seatunnel · error · JdbcConnectorException

NO_SUITABLE_DRIVER

NO_SUITABLE_DRIVER

Error message

No suitable driver found for the configured JDBC URL

What it means

HiveJdbcConnectionProvider.getOrEstablishConnection checks the produced connection; if null (the driver did not accept the URL), it throws JdbcConnectorException with NO_SUITABLE_DRIVER, replicating DriverManager semantics for missing drivers.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/hive/HiveJdbcConnectionProvider.java:61

    @Override
    public Connection getOrEstablishConnection() throws SQLException, ClassNotFoundException {
        if (isConnectionValid()) {
            return super.getConnection();
        }
        JdbcConnectionConfig jdbcConfig = super.getJdbcConfig();
        final Driver driver = getLoadedDriver();
        HiveConnectionProduceFunction hiveConnectionProduceFunction =
                new HiveConnectionProduceFunction(driver, jdbcConfig);

        if (jdbcConfig.isUseKerberos()) {
            super.setConnection(getConnectionWithKerberos(hiveConnectionProduceFunction));
        } else {
            super.setConnection(hiveConnectionProduceFunction.produce());
        }
        if (super.getConnection() == null) {
            // Throw same exception as DriverManager.getConnection when no driver found to match
            // caller expectation.
            throw new JdbcConnectorException(
                    JdbcConnectorErrorCode.NO_SUITABLE_DRIVER,
                    "No suitable driver found for the configured JDBC URL");
        }
        return super.getConnection();
    }

    private Connection getConnectionWithKerberos(
            HiveConnectionProduceFunction hiveConnectionProduceFunction) {
        try {
            Configuration configuration = new Configuration();
            configuration.set("hadoop.security.authentication", "kerberos");
            return HadoopLoginFactory.loginWithKerberos(
                    configuration,
                    jdbcConfig.getKrb5Path(),
                    jdbcConfig.getKerberosPrincipal(),
                    jdbcConfig.getKerberosKeytabPath(),
                    (conf, userGroupInformation) -> hiveConnectionProduceFunction.produce());
        } catch (Exception ex) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Download/install the Hive JDBC driver jar into the connector driver path (e.g. via sh bin/install-plugin.sh or manual placement) and retry.
  2. Verify the configured url starts with jdbc:hive2: and points to the correct host/port.
  3. Enable driver-loading debug logs to confirm the driver class is being registered on startup.

Example fix

// before (driver missing)
url = "jdbc:hive2://hive-host:10000/default"
// after
# cp hive-jdbc-<ver>.jar $SEATUNNEL_HOME/connectors/connector-jdbc/lib/
url = "jdbc:hive2://hive-host:10000/default"
Defensive patterns

Strategy: validation

Validate before calling

boolean hiveDriverLoaded() { try { Class.forName("org.apache.hive.jdbc.HiveDriver"); return true; } catch (ClassNotFoundException e) { return false; } }

Type guard

if (!url.startsWith("jdbc:hive2:")) throw new IllegalArgumentException("Hive url must start with jdbc:hive2:");

Try / catch

try { conn = provider.getOrEstablishConnection(); } catch (JdbcConnectorException e) { if (e.getErrorCode() == JdbcConnectorErrorCode.NO_SUITABLE_DRIVER) { /* install hive jdbc driver jar and retry */ } else throw e; }

Prevention

When it happens

Trigger: Opening a Hive (jdbc:hive2:) connection where no registered Driver accepts the configured URL because the Hive JDBC driver jar is absent from the classpath/plugin drivers directory.

Common situations: Hive driver not bundled/downloaded (install-plugin.sh not executed), wrong URL scheme, driver conflict or shading issue preventing Driver registration.

Related errors


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