这是Kafka Connect日志中显示的错误。我使用Kafka-connect作为与Debezium的连接器。
java.lang.RuntimeException: Failed to resolve Oracle database version
at io.debezium.connector.oracle.OracleConnection.resolveOracleDatabaseVersion(OracleConnection.java:166)
at io.debezium.connector.oracle.OracleConnection.<init>(OracleConnection.java:76)
at io.debezium.connector.oracle.OracleConnection.<init>(OracleConnection.java:71)
at io.debezium.connector.oracle.OracleConnector.validateConnection(OracleConnector.java:74)
at io.debezium.connector.common.RelationalBaseSourceConnector.validate(RelationalBaseSourceConnector.java:54)
at org.apache.kafka.connect.runtime.AbstractHerder.validateConnectorConfig(AbstractHerder.java:459)
at org.apache.kafka.connect.runtime.AbstractHerder.lambda$validateConnectorConfig$2(AbstractHerder.java:362)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@localhost:1521/ORCLCDB
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:702)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:189)
at io.debezium.jdbc.JdbcConnection.lambda$patternBasedFactory$0(JdbcConnection.java:191)
at io.debezium.jdbc.JdbcConnection$ConnectionFactoryDecorator.connect(JdbcConnection.java:128)
at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:882)
at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:877)
at io.debezium.jdbc.JdbcConnection.queryAndMap(JdbcConnection.java:630)
at io.debezium.jdbc.JdbcConnection.queryAndMap(JdbcConnection.java:504)
at io.debezium.connector.oracle.OracleConnection.resolveOracleDatabaseVersion(OracleConnection.java:136)
我使用Oracle插件路径连接Debezium实现CDC。
要调试它,您可以尝试检查类路径/类加载器,以确保正在加载哪个java/类/版本。以下链接:
检查→使用jinfo实用程序https://docs.oracle.com/javase/9/troubleshoot/diagnostic-tools.htm#JSTGD198
排除故障JConsole https://docs.oracle.com/javase/6/docs/technotes/guides/management/jconsole.html
显然,您也可以在操作系统级别检查它:https://docs.oracle.com/javase/tutorial/essential/environment/paths.html
这样,你就可以确定为什么你会收到相关的信息。