taosdata / kafka-connect-tdengine

GNU Affero General Public License v3.0
15 stars 5 forks source link

Could not initialize class com.taosdata.jdbc.TSDBJNIConnector #72

Open 2779382063 opened 1 month ago

2779382063 commented 1 month ago

使用Source Connector,kafka装了TDEngine客户端还是报了以下错误,我看了kafka-connect-tdengine-3.0的lib库下taos-jdbc驱动是3.3.3,所以在上面也装了3.3.3的TDEngine客户端(装3.0.7.1的客户端也是一样报以下错误),我的TDEngine服务端是3.0.7.1。 [2024-10-22 16:19:11,277] ERROR [tdengine-source-3|worker] [Worker clientId=connect-1, groupId=connect-cluster] Failed to start connector 'tdengine-source-3' (org.apache.kafka.connect.runtime.distributed.DistributedHerder:1829) org.apache.kafka.connect.errors.ConnectException: Failed to start connector: tdengine-source-3 at org.apache.kafka.connect.runtime.distributed.DistributedHerder.lambda$startConnector$34(DistributedHerder.java:1800) at org.apache.kafka.connect.runtime.WorkerConnector.doTransitionTo(WorkerConnector.java:346) at org.apache.kafka.connect.runtime.WorkerConnector.doRun(WorkerConnector.java:143) at org.apache.kafka.connect.runtime.WorkerConnector.run(WorkerConnector.java:121) at org.apache.kafka.connect.runtime.isolation.Plugins.lambda$withClassLoader$1(Plugins.java:177) 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:750) Caused by: org.apache.kafka.connect.errors.ConnectException: Failed to transition connector tdengine-source-3 to state STARTED ... 9 more Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.taosdata.jdbc.TSDBJNIConnector at com.taosdata.jdbc.TSDBDriver.connect(TSDBDriver.java:175) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:208) at com.taosdata.kafka.connect.db.TSDBConnectionProvider.getConnection(TSDBConnectionProvider.java:35) at com.taosdata.kafka.connect.source.MonitorThread.init(MonitorThread.java:51) at com.taosdata.kafka.connect.source.MonitorThread.(MonitorThread.java:41) at com.taosdata.kafka.connect.source.TDengineSourceConnector.start(TDengineSourceConnector.java:30) at org.apache.kafka.connect.runtime.WorkerConnector.doStart(WorkerConnector.java:190) at org.apache.kafka.connect.runtime.WorkerConnector.start(WorkerConnector.java:215) at org.apache.kafka.connect.runtime.WorkerConnector.doTransitionTo(WorkerConnector.java:360) at org.apache.kafka.connect.runtime.WorkerConnector.doTransitionTo(WorkerConnector.java:343) ... 8 more

superliujian commented 1 week ago

需要引用3.3.4的JDBC才行。编译的Sink connection引用了一个函数setByteArray,这个函数在3.3.3的JDBC库中没有