我正在尝试使用Kafka连接部署debezium db2连接器(debezium不可变docker映像(。但是,当我使用kafkaRESTapi部署db2连接器时,它在kafkaconnect日志中给出了以下错误。
"2021-06-13 14:24:35,225 ERROR || WorkerSourceTask{id=lifestyle-connector-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted [org.apache.kafka.connect.runtime.WorkerTask]
java.lang.NoClassDefFoundError: com/ibm/db2/jcc/DB2Driver
at io.debezium.connector.db2.Db2Connection.<clinit>(Db2Connection.java:91)
at io.debezium.connector.db2.Db2ConnectorTask.start(Db2ConnectorTask.java:74)
at io.debezium.connector.common.BaseSourceTask.start(BaseSourceTask.java:130)
at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:232)
at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:185)
at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)
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:834)
Caused by: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at org.apache.kafka.connect.runtime.isolation.PluginClassLoader.loadClass(PluginClassLoader.java:104)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 11 more"
我参考了以下教程https://debezium.io/documentation/reference/tutorial.html#starting-kafka连接
我已经使用bin bash登录到kafka连接,并将db2 dependencies jar从本地文件夹复制到lib文件夹。这解决了我的问题。