Okay, yet it's a classloader issue. I would try another way. Remove all
five jars from the classpath and replace them with the ucanload.jar file in
the distribution. Notice that in this case the classloader will dynamically
load the other jars so its position is very important and can't be moved
from that in the distribution.
Please let me know the result.
It worked with the 5 jars.
Earlier, I was only placing the jars in the connect-jdbc directory because that is where kafka loads all the jars/plugins. but this time I explicitly define the classpath as given in console.sh script and it worked after that.
I will try the alternate approach suggested by you and will let you know.
Thanks for the help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have loaded all the 5 jars as given in the logs:
[2020-08-06 11:18:34,568] INFO Loading plugin from: /home/vaishali/confluent-5.5.0/share/java/kafka-connect-jdbc/commons-lang3-3.8.1.jar (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:239)
[2020-08-06 11:18:34,568] DEBUG Loading plugin urls: [file:/home/vaishali/confluent-5.5.0/share/java/kafka-connect-jdbc/commons-lang3-3.8.1.jar] (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:246)
[2020-08-06 11:18:34,614] INFO Registered loader: PluginClassLoader{pluginLocation=file:/home/vaishali/confluent-5.5.0/share/java/kafka-connect-jdbc/commons-lang3-3.8.1.jar} (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:262)
[2020-08-06 11:18:34,614] INFO Loading plugin from: /home/vaishali/confluent-5.5.0/share/java/kafka-connect-jdbc/commons-logging-1.2.jar (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:239)
[2020-08-06 11:18:34,615] DEBUG Loading plugin urls: [file:/home/vaishali/confluent-5.5.0/share/java/kafka-connect-jdbc/commons-logging-1.2.jar] (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:246)
[2020-08-06 11:18:34,629] INFO Registered loader: PluginClassLoader{pluginLocation=file:/home/vaishali/confluent-5.5.0/share/java/kafka-connect-jdbc/commons-logging-1.2.jar} (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:262)
[2020-08-06 11:18:34,630] INFO Loading plugin from: /home/vaishali/confluent-5.5.0/share/java/kafka-connect-jdbc/hsqldb-2.5.0.jar (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:239)
[2020-08-06 11:18:34,630] DEBUG Loading plugin urls: [file:/home/vaishali/confluent-5.5.0/share/java/kafka-connect-jdbc/hsqldb-2.5.0.jar] (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:246)
[2020-08-06 11:18:34,754] INFO Registered loader: PluginClassLoader{pluginLocation=file:/home/vaishali/confluent-5.5.0/share/java/kafka-connect-jdbc/hsqldb-2.5.0.jar} (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:262)
[2020-08-06 11:18:34,756] DEBUG Registered java.sql.Driver: org.hsqldb.jdbc.JDBCDriver@65e98b1c to java.sql.DriverManager (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:298)
[2020-08-06 11:18:34,756] INFO Loading plugin from: /home/vaishali/confluent-5.5.0/share/java/kafka-connect-jdbc/jackcess-3.0.1.jar (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:239)
[2020-08-06 11:18:34,757] DEBUG Loading plugin urls: [file:/home/vaishali/confluent-5.5.0/share/java/kafka-connect-jdbc/jackcess-3.0.1.jar] (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:246)
[2020-08-06 11:18:34,845] INFO Registered loader: PluginClassLoader{pluginLocation=file:/home/vaishali/confluent-5.5.0/share/java/kafka-connect-jdbc/jackcess-3.0.1.jar} (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:262)
[2020-08-06 11:18:34,846] INFO Loading plugin from: /home/vaishali/confluent-5.5.0/share/java/kafka-connect-jdbc/ucanaccess-5.0.0.jar (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:239)
[2020-08-06 11:18:34,846] DEBUG Loading plugin urls: [file:/home/vaishali/confluent-5.5.0/share/java/kafka-connect-jdbc/ucanaccess-5.0.0.jar] (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:246)
[2020-08-06 11:18:34,896] INFO Registered loader: PluginClassLoader{pluginLocation=file:/home/vaishali/confluent-5.5.0/share/java/kafka-connect-jdbc/ucanaccess-5.0.0.jar} (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:262)
[2020-08-06 11:18:34,902] DEBUG Ignoring java.sql.Driver classes listed in resources but not present in class loader's classpath: (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:304)
java.util.ServiceConfigurationError: java.sql.Driver: Provider net.ucanaccess.jdbc.UcanaccessDriver could not be instantiated
Okay, yet it's a classloader issue. I would try another way. Remove all
five jars from the classpath and replace them with the ucanload.jar file in
the distribution. Notice that in this case the classloader will dynamically
load the other jars so its position is very important and can't be moved
from that in the distribution.
Please let me know the result.
Il Gio 6 Ago 2020, 19:32 Vaishali Saraswat vaishali11@users.sourceforge.net
ha scritto:
Hi Marco,
It worked with the 5 jars.
Earlier, I was only placing the jars in the connect-jdbc directory because that is where kafka loads all the jars/plugins. but this time I explicitly define the classpath as given in console.sh script and it worked after that.
I will try the alternate approach suggested by you and will let you know.
Thanks for the help.