开发者社区> 问答> 正文

canal adapter 同步数据时候报java.lang.NullPointerExceptio

环境信息

canal.deployer-1.1.1-SNAPSHOT canal.adapter-1.1.3-SNAPSHOT mysql 5.7.21

问题描述

2019-03-07 14:23:28.021 INFO 14266 --- [ main] c.a.o.c.a.l.loader.CanalAdapterLoader : Start adapter for canal instance: AFSA2 succeed 2019-03-07 14:23:28.021 INFO 14266 --- [ main] c.a.o.c.a.l.loader.CanalAdapterService : ## the canal client adapters are running now ...... 2019-03-07 14:23:28.021 INFO 14266 --- [ Thread-4] c.a.o.c.a.l.loader.CanalAdapterWorker : =============> Start to connect destination: AFSA2 <============= 2019-03-07 14:23:28.053 INFO 14266 --- [ main] c.a.o.c.a.l.CanalAdapterApplication : Started CanalAdapterApplication in 7.31 seconds (JVM running for 7.649) 2019-03-07 14:23:28.085 INFO 14266 --- [ Thread-4] c.a.o.c.a.l.loader.CanalAdapterWorker : =============> Start to subscribe destination: AFSA2 <============= 2019-03-07 14:23:28.124 INFO 14266 --- [ Thread-4] c.a.o.c.a.l.loader.CanalAdapterWorker : =============> Subscribe destination: AFSA2 succeed <============= 2019-03-07 14:24:36.289 ERROR 14266 --- [pool-7-thread-1] c.a.o.c.a.l.loader.CanalAdapterWorker : java.util.concurrent.ExecutionException: java.lang.NullPointerException

java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException at com.alibaba.otter.canal.client.adapter.rdb.RdbAdapter.sync(RdbAdapter.java:171) ~[na:na] at com.alibaba.otter.canal.adapter.launcher.loader.AbstractCanalAdapterWorker.batchSync(AbstractCanalAdapterWorker.java:197) ~[client-adapter.launcher-1.1.3-SNAPSHOT.jar:na] at com.alibaba.otter.canal.adapter.launcher.loader.AbstractCanalAdapterWorker.lambda$null$1(AbstractCanalAdapterWorker.java:61) ~[client-adapter.launcher-1.1.3-SNAPSHOT.jar:na] at java.util.ArrayList.forEach(ArrayList.java:1257) ~[na:1.8.0_172] at com.alibaba.otter.canal.adapter.launcher.loader.AbstractCanalAdapterWorker.lambda$null$2(AbstractCanalAdapterWorker.java:57) ~[client-adapter.launcher-1.1.3-SNAPSHOT.jar:na] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_172] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_172] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_172] at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_172] Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:1.8.0_172] at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[na:1.8.0_172] at com.alibaba.otter.canal.client.adapter.rdb.RdbAdapter.sync(RdbAdapter.java:168) ~[na:na] ... 8 common frames omitted Caused by: java.lang.NullPointerException: null at com.alibaba.otter.canal.client.adapter.rdb.service.RdbSyncService.pkHash(RdbSyncService.java:444) ~[na:na] at com.alibaba.otter.canal.client.adapter.rdb.service.RdbSyncService.pkHash(RdbSyncService.java:438) ~[na:na] at com.alibaba.otter.canal.client.adapter.rdb.service.RdbSyncService.lambda$null$3(RdbSyncService.java:160) ~[na:na] at java.util.ArrayList.forEach(ArrayList.java:1257) ~[na:1.8.0_172] at com.alibaba.otter.canal.client.adapter.rdb.service.RdbSyncService.lambda$sync$5(RdbSyncService.java:159) ~[na:na] at com.alibaba.otter.canal.client.adapter.rdb.service.RdbSyncService.sync(RdbSyncService.java:98) ~[na:na] at com.alibaba.otter.canal.client.adapter.rdb.service.RdbSyncService.sync(RdbSyncService.java:139) ~[na:na] at com.alibaba.otter.canal.client.adapter.rdb.RdbAdapter.lambda$sync$2(RdbAdapter.java:160) ~[na:na] ... 4 common frames omitted

2019-03-07 14:24:36.289 ERROR 14266 --- [ Thread-4] c.a.o.c.a.l.loader.CanalAdapterWorker : Outer adapter sync failed! Error sync but ACK!

步骤重现

canal 和canal adapter启动成功,在源数据库插入新的数据,log 报上面错误

原提问者GitHub用户TiandeJohn

展开
收起
古拉古拉 2023-05-08 13:51:56 86 0
1 条回答
写回答
取消 提交回答
  • 请使用最新代码构建打包再试一下

    原回答者GitHub用户agapple

    2023-05-09 17:49:00
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载