Search code examples
javaapache-kafkadb2debezium

Java Lang Null Pointer Error connecting DB2 iOS with Debezium and Kakfa Connect for CDC pull


I am trying to connect to DB2 iOS through Kafka Connect - Debezium for CDC pull from DB2 tables and stuck at one point with below error. Tried all sorts of changes but could not make it work. Any one encountered this issue or what could have gone wrong or indicative of this issue? Appreciate your help.DB2 properties file provided below.

[2022-01-21 22:29:50,043] ERROR Failed testing connection for 
dbc:db2://ABCD:123/Servername with user 'ABC' (io.debezium.connector.db2.Db2Connector:84)
com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, 
SQLERRMC=;;<END-OF-STATEMENT>, DRIVER=3.68.61
    at com.ibm.db2.jcc.am.gd.a(gd.java:749)
    at com.ibm.db2.jcc.am.gd.a(gd.java:66)
    at com.ibm.db2.jcc.am.gd.a(gd.java:135)
    at com.ibm.db2.jcc.am.uo.c(uo.java:2780)
    at com.ibm.db2.jcc.am.uo.d(uo.java:2768)
    at com.ibm.db2.jcc.am.uo.a(uo.java:2217)
    at com.ibm.db2.jcc.t4.bb.h(bb.java:141)
    at com.ibm.db2.jcc.t4.bb.b(bb.java:41)
    at com.ibm.db2.jcc.t4.p.a(p.java:32)
    at com.ibm.db2.jcc.t4.vb.i(vb.java:145)
    at com.ibm.db2.jcc.am.uo.ib(uo.java:2186)
    at com.ibm.db2.jcc.am.uo.a(uo.java:3267)
    at com.ibm.db2.jcc.am.uo.e(uo.java:1102)
    at com.ibm.db2.jcc.am.uo.execute(uo.java:1081)
    at io.debezium.jdbc.JdbcConnection.lambda$execute$2(JdbcConnection.java:433)
    at io.debezium.jdbc.JdbcConnection.execute(JdbcConnection.java:450)
    at io.debezium.jdbc.JdbcConnection.execute(JdbcConnection.java:427)
    at io.debezium.connector.db2.Db2Connector.validateConnection(Db2Connector.java:80)
    at io.debezium.connector.common.RelationalBaseSourceConnector.validate(RelationalBaseSourceConnector.java:54)
    at org.apache.kafka.connect.runtime.AbstractHerder.validateConnectorConfig(AbstractHerder.java:375)
    at org.apache.kafka.connect.runtime.AbstractHerder.lambda$validateConnectorConfig$1(AbstractHerder.java:326)
    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:748)
    [2022-01-21 22:29:50,050] INFO Connection gracefully closed 
    (io.debezium.jdbc.JdbcConnection:965)
    [2022-01-21 22:29:50,052] INFO AbstractConfig values:      (org.apache.kafka.common.config.AbstractConfig:354)
    [2022-01-21 22:29:50,058] ERROR Failed to create job for kafka_2.12-2.6.3/config/connect- debezium-db2.properties (org.apache.kafka.connect.cli.ConnectStandalone:110)
    [2022-01-21 22:29:50,059] ERROR Stopping after connector error     (org.apache.kafka.connect.cli.ConnectStandalone:121)
    java.util.concurrent.ExecutionException: java.lang.NullPointerException
    at org.apache.kafka.connect.util.ConvertingFutureCallback.result(ConvertingFutureCallback.java:115)
    at org.apache.kafka.connect.util.ConvertingFutureCallback.get(ConvertingFutureCallback.java:99)
    at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:118)
Caused by: java.lang.NullPointerException
    at org.apache.kafka.connect.runtime.AbstractHerder.maybeAddConfigErrors(AbstractHerder.java:605)
    at org.apache.kafka.connect.runtime.standalone.StandaloneHerder.putConnectorConfig(StandaloneHerder.java:215)
    at org.apache.kafka.connect.runtime.standalone.StandaloneHerder.lambda$null$1(StandaloneHerder.java:201)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    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:748)

**DB2 Connect Properties**
name=db2-connector
connector.class=io.debezium.connector.db2.Db2Connector
tasks.max=1
database.server.name=ABCD
database.hostname=ABCD
database.port=123
database.user=DB2username
database.password=DB2password
database.dbname=dbname
database.server.id=1
database.history.kafka.bootstrap.servers=localhost:9092
database.history.kafka.topic=db_f0006
table.include.list=DEVLIB.F0006
tombstones.on.delete=false
include.schema.changes=true 

Solution

  • Debezium is not compatible sur DB2 iSeries, i know no Free tool to Replicate data from DB2 iSeries to Kafka. Only commercial one do that: IIDR (former DMIRROR IBM, DataDistribution (gamma-soft)