{"record":{"id":"8e81e40e6017b798","repo":"apache/seatunnel","slug":"no-suitable-driver-8e81e4","errorCode":"NO_SUITABLE_DRIVER","errorMessage":"No suitable driver found for the configured JDBC URL","messagePattern":"No suitable driver found for the configured JDBC URL","errorType":"error_code","errorClass":"JdbcConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/hive/HiveJdbcConnectionProvider.java","lineNumber":61,"sourceCode":"    @Override\n    public Connection getOrEstablishConnection() throws SQLException, ClassNotFoundException {\n        if (isConnectionValid()) {\n            return super.getConnection();\n        }\n        JdbcConnectionConfig jdbcConfig = super.getJdbcConfig();\n        final Driver driver = getLoadedDriver();\n        HiveConnectionProduceFunction hiveConnectionProduceFunction =\n                new HiveConnectionProduceFunction(driver, jdbcConfig);\n\n        if (jdbcConfig.isUseKerberos()) {\n            super.setConnection(getConnectionWithKerberos(hiveConnectionProduceFunction));\n        } else {\n            super.setConnection(hiveConnectionProduceFunction.produce());\n        }\n        if (super.getConnection() == null) {\n            // Throw same exception as DriverManager.getConnection when no driver found to match\n            // caller expectation.\n            throw new JdbcConnectorException(\n                    JdbcConnectorErrorCode.NO_SUITABLE_DRIVER,\n                    \"No suitable driver found for the configured JDBC URL\");\n        }\n        return super.getConnection();\n    }\n\n    private Connection getConnectionWithKerberos(\n            HiveConnectionProduceFunction hiveConnectionProduceFunction) {\n        try {\n            Configuration configuration = new Configuration();\n            configuration.set(\"hadoop.security.authentication\", \"kerberos\");\n            return HadoopLoginFactory.loginWithKerberos(\n                    configuration,\n                    jdbcConfig.getKrb5Path(),\n                    jdbcConfig.getKerberosPrincipal(),\n                    jdbcConfig.getKerberosKeytabPath(),\n                    (conf, userGroupInformation) -> hiveConnectionProduceFunction.produce());\n        } catch (Exception ex) {","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/hive/HiveJdbcConnectionProvider.java#L43-L79","documentation":"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.","triggerScenarios":"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.","commonSituations":"Hive driver not bundled/downloaded (install-plugin.sh not executed), wrong URL scheme, driver conflict or shading issue preventing Driver registration.","solutions":["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.","Verify the configured url starts with jdbc:hive2: and points to the correct host/port.","Enable driver-loading debug logs to confirm the driver class is being registered on startup."],"exampleFix":"// before (driver missing)\nurl = \"jdbc:hive2://hive-host:10000/default\"\n// after\n# cp hive-jdbc-<ver>.jar $SEATUNNEL_HOME/connectors/connector-jdbc/lib/\nurl = \"jdbc:hive2://hive-host:10000/default\"","handlingStrategy":"validation","validationCode":"boolean hiveDriverLoaded() { try { Class.forName(\"org.apache.hive.jdbc.HiveDriver\"); return true; } catch (ClassNotFoundException e) { return false; } }","typeGuard":"if (!url.startsWith(\"jdbc:hive2:\")) throw new IllegalArgumentException(\"Hive url must start with jdbc:hive2:\");","tryCatchPattern":"try { conn = provider.getOrEstablishConnection(); } catch (JdbcConnectorException e) { if (e.getErrorCode() == JdbcConnectorErrorCode.NO_SUITABLE_DRIVER) { /* install hive jdbc driver jar and retry */ } else throw e; }","preventionTips":["Install the Hive JDBC driver via install-plugin.sh or manual jar placement","Keep driver jars in the expected connectors lib directory","Validate the jdbc:hive2: URL before launching jobs"],"tags":["jdbc","hive","driver","connection"],"backgroundTag":"no-suitable-driver","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}