Kafka java.lang.RuntimeException:无法解析Oracle数据库版本

b4wnujal  于 2023-11-16  发布在  Apache
关注(0)|答案(3)|浏览(181)

我在Kafka connect中使用debezium oracle连接器。当启动连接器时,我得到以下错误,

java.lang.RuntimeException: Failed to resolve Oracle database version
        at io.debezium.connector.oracle.OracleConnection.resolveOracleDatabaseVersion(OracleConnection.java:159)
        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:52)
        at org.apache.kafka.connect.runtime.AbstractHerder.validateConnectorConfig(AbstractHerder.java:400)
        at org.apache.kafka.connect.runtime.AbstractHerder.lambda$validateConnectorConfig$2(AbstractHerder.java:351)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@**.**.*.**:1521/CDB
        at java.sql.DriverManager.getConnection(DriverManager.java:689)
        at java.sql.DriverManager.getConnection(DriverManager.java:208)
        at io.debezium.jdbc.JdbcConnection.lambda$patternBasedFactory$0(JdbcConnection.java:184)
        at io.debezium.jdbc.JdbcConnection$ConnectionFactoryDecorator.connect(JdbcConnection.java:121)
        at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:890)
        at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:885)
        at io.debezium.jdbc.JdbcConnection.queryAndMap(JdbcConnection.java:643)
        at io.debezium.jdbc.JdbcConnection.queryAndMap(JdbcConnection.java:517)
        at io.debezium.connector.oracle.OracleConnection.resolveOracleDatabaseVersion(OracleConnection.java:129)
        ... 10 more

字符串
我正在访问Oracle设置和连接器配置的链接,

**https://debezium.io/documentation/reference/connectors/oracle.html#setting-up-oracle**

connector-configuration.properties

name=debeziumoraclesource
connector.class=io.debezium.connector.oracle.OracleConnector
database.hostname=**.*.**.**
database.port=1521
database.user=username
database.password=password
database.dbname=CDBNAME
database.server.name=**.*.**.**
tasks.max=1
database.pdb.name=PDBNAME
database.history.kafka.bootstrap.servers=kafka:9092
database.history.kafka.topic=history.ENTITY_GROUP_PARAMETER_VALUES
database.connection.adaptor=logminer
snapshot.mode=initial
table.include.list=schema.ENTITY_GROUP_PARAMETER_VALUES


另外,我已经下载了ojdbc8.jar并放置在Kafka/libs文件夹中。我尝试使用不同版本的jar,如ojdbc 10和不同版本的ojdbc8.Nothing帮助我。另外,值得注意的是,我使用的是oracle19c.Please帮助我解决这个问题。提前感谢。

jaxagkaj

jaxagkaj1#

使用OJDBC6.jar和所有依赖项帮助我解决了这个问题。最重要的是,我把jar放在连接器lib文件夹中。

ymdaylpp

ymdaylpp2#

使用OJDBC8.jar帮助我解决了这个问题,问题出现了,因为我没有把jar放在所有运行Kafka connect的服务器上。

8fsztsew

8fsztsew3#

我使用confluentinc-kafka-connect-jdbc-10.7.4 & debezium-connector-oracle连接器。最初我使用CLASSPATH来解决jar,但由于问题我删除了它。我复制了ojdbc8-19.7.0.0.jar,或ai18n-19.7.0.0.jar,ucp-19.7.0.0.jar从confluentinc-kafka-connect-jdbc-10.7.4\lib到debezium-connector-oracle\lib,这解决了问题。

相关问题