No suitbale Diver for JDBC-Connector PostgreSQL

Hi, I am new to Kafka and I am trying to get my JDBC-Connector started but I got the same error over and over: java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost:5432/TEST_SM

I already read the article Kafka Connect Deep Dive – JDBC Source Connector | Confluent but it didnt fix the problem or I couldnt run it properly.
I tried to run it in standalone mode and in the distributed mode as well.

Since the postgres jdbc driver is already installed in the same directory as the kafka-connector-jdbc.jar I havent download another driver. The database already exist and I can run it in DBeaver and make requests.

Here is my POST request for generating the connector:
curl -X POST http://localhost:8083/connectors -H “Content-Type: application/json” -d ‘{
“name”: “jdbc_source_mysql_03”,
“config”: {
“connector.class”: “io.confluent.connect.jdbc.JdbcSourceConnector”,
“connection.url”: “jdbc:postgresql://localhost:5432/TEST_SM”,
“connection.user”: “postgres”,
“connection.password”: “*****”,
“topic.prefix”: “jdbc”,
“mode”:“bulk”,
“poll.interval.ms” : 3600000
}
}’

I changed the loglevel to DEBUG and it even registered the driver, BUT not immediately after the “INFO Added plugin JDBCSourceConnector” as stated in the article.
[2024-07-18 14:07:01,024] DEBUG Registered java.sql.Driver: org.postgresql.Driver@7c24b813 to java.sql.DriverManager (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:335)
I also deactivated the authorization, but it did not work either.

What am I missing? Thanks for the help

hey @AslNa welcome :slight_smile:

how does your config dir look like?
did you check the following thread:

best,
michael

Thank for your response @mmuehlbeyer .
Yes I read it. The plugin-path is pointing at the lib dir where all the jars are. The console prints out that he found the plugin for the driver and for the kafka connector (as well as all the other jars in lib).

my plugin-path in the connected-distributed.properties file:
plugin.path=/Dev_Programme/kafka_2.13-3.5.1/connectors/confluentinc-kafka-connect-jdbc-10.7.6/lib

you might try to update the plugin.path parameter to
plugin.path=/Dev_Programme/kafka_2.13-3.5.1/connectors/confluentinc-kafka-connect-jdbc-10.7.6

1 Like

THANKS! Seems like it was solved.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.