I am trying to run an oracle source connector in Kafka using Oracle jdbc8 (ojdbc8.jar) in standalone mode. I have downloaded the confluent's jdbc jars and also the ojdbc8.jar from the Oracle website. I have tested this locally and it worked fine, but on our test environment, it is throwing the following error:
No suitable driver found for jdbc:oracle:thin:@x.x.x.x:yyyy:zzz for configuration Couldn't open connection to jdbc:oracle:thin:@x.x.x.x:yyyy:zzz
Full error message:
ERROR Failed to create job for xyz/xyz.properties (org.apache.kafka.connect.cli.ConnectStandalone:110)
[2020-03-11 13:13:32,085] ERROR Stopping after connector error (org.apache.kafka.connect.cli.ConnectStandalone:121)
java.util.concurrent.ExecutionException: org.apache.kafka.connect.runtime.rest.errors.BadRequestException: Connector configuration is invalid and contains the following 2 error(s):
Invalid value java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@x.x.x.x:1521:xyz for configuration Couldn't open connection to jdbc:oracle:thin:@x.x.x.x:1521:xyz
Invalid value java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@x.x.x.x:1521:xyz for configuration Couldn't open connection to jdbc:oracle:thin:@x.x.x.x:1521:xyz
Plugins' path is also fine as it is registering all the jars. I have tried some fixes I found online which included putting the plugins path in the CLASSPATH variable. It didn't work, threw the same error as aforementioned. I am also able to ping and telnet the IP and Port respectively.
My connector configurations are as follows:
name=oracle-jdbc-connect
connector.class=io.confluent.connect.jdbc.JdbcSourceConnector
tasks.max=1
connection.url=jdbc:oracle:thin:@x.x.x.x:yyyy:zzz
connection.user=xyz
connection.password=xyz
query=SELECT cast(ID AS NUMBER(7, 0)) AS ID, NAME FROM sch.tbl
mode=incrementing
incrementing.column.name=ID
topic.prefix=topic-test
schema.pattern=sch
numeric.mapping=best_fit
dialect.name=OracleDatabaseDialect
timestamp.delay.interval.ms=5000
key.converter=org.apache.kafka.connect.json.JsonConverter
value.converter=org.apache.kafka.connect.json.JsonConverter
key.converter.schemas.enable=false
value.converter.schemas.enable=false
decimal.handling.mode=double
include.schema.changes=false
The connection.user given here has 'read-only' privileges in Oracle though. Can that be an issue here?
connect-standalone.properties file is as follows:
key.converter=org.apache.kafka.connect.json.JsonConverter
value.converter=org.apache.kafka.connect.json.JsonConverter
key.converter.schemas.enable=true
value.converter.schemas.enable=true
offset.storage.file.filename=/tmp/connect.offsets
offset.flush.interval.ms=10000
rest.host.name=x.x.x.x
rest.port=8877 # Some random port
plugin.path=/home/plugins/,/usr/share/java,/usr/local/share/kafka/plugins
Oracle Version: 18c
Kafka Version: 2.3.0
Scala Version: 2.12.2
plugins.path: /home/plugins
Plugins Path Structure: /home/plugins/connectors/ [Folders like assets, docs, lib etc.], ojdbc8.jar.
Inside /home/plugins/connectors/lib, I have kafka-connect-jdbc-5.4.0.jar file.
Couldn't open connection to jdbc:oracle:thin:@x.x.x.x:yyyy:zzz
? – Robin Moffatt