开发者社区> 问答> 正文

canal.adapter-1.1.5 空指针 不知道哪里配置的问题

2021-08-20 03:11:07.034 [Thread-4] ERROR c.a.otter.canal.adapter.launcher.loader.AdapterProcessor - Outer adapter sync failed! Error sync and rollback, execute times: 1 2021-08-20 03:11:08.037 [pool-11-thread-1] INFO c.a.o.canal.client.adapter.logger.LoggerAdapterExample - DML: {"data":[{"id":"133190FF23384846BCE9B12A71C7F7AB","data_type":"0","method_code":"62-5","data_id":"2575477","user_id":"13234","product_code":"123456543","status":0,"error_message":null,"create_date":1585376951000,"update_date":1585376951000,"region":null,"org_id":"1212","sync_type":67,"weight":67}],"database":"sp","destination":"example","es":1629429066000,"groupId":"g1","isDdl":false,"old":null,"pkNames":["id"],"sql":"","table":"phms_sync_data_20200804","ts":1629429068035,"type":"INSERT"} 2021-08-20 03:11:08.045 [pool-11-thread-1] ERROR c.a.otter.canal.adapter.launcher.loader.AdapterProcessor - java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NullPointerException java.lang.RuntimeException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: 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.AdapterProcessor.batchSync(AdapterProcessor.java:139) ~[client-adapter.launcher-1.1.5.jar:na] at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.lambda$null$1(AdapterProcessor.java:97) ~[client-adapter.launcher-1.1.5.jar:na] at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:895) ~[na:1.8.0_292] at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.lambda$null$2(AdapterProcessor.java:94) ~[client-adapter.launcher-1.1.5.jar:na] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_292] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_292] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_292] at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_292] Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NullPointerException at com.alibaba.otter.canal.client.adapter.rdb.service.RdbSyncService.lambda$sync$2(RdbSyncService.java:133) ~[na:na] at java.util.ArrayList.forEach(ArrayList.java:1259) ~[na:1.8.0_292] at com.alibaba.otter.canal.client.adapter.rdb.service.RdbSyncService.sync(RdbSyncService.java:129) ~[na:na] at com.alibaba.otter.canal.client.adapter.rdb.service.RdbSyncService.sync(RdbSyncService.java:153) ~[na:na] at com.alibaba.otter.canal.client.adapter.rdb.RdbAdapter.sync(RdbAdapter.java:168) ~[na:na] ... 8 common frames omitted Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NullPointerException at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:1.8.0_292] at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[na:1.8.0_292] at com.alibaba.otter.canal.client.adapter.rdb.service.RdbSyncService.lambda$sync$2(RdbSyncService.java:131) ~[na:na] ... 12 common frames omitted Caused by: java.lang.RuntimeException: java.lang.NullPointerException at com.alibaba.otter.canal.client.adapter.rdb.service.RdbSyncService.lambda$sync$1(RdbSyncService.java:124) ~[na:na] ... 4 common frames omitted Caused by: java.lang.NullPointerException: null at com.alibaba.otter.canal.client.adapter.rdb.service.RdbSyncService.insert(RdbSyncService.java:250) ~[na:na] at com.alibaba.otter.canal.client.adapter.rdb.service.RdbSyncService.sync(RdbSyncService.java:214) ~[na:na] at com.alibaba.otter.canal.client.adapter.rdb.service.RdbSyncService.lambda$null$0(RdbSyncService.java:115) ~[na:na] at java.util.ArrayList.forEach(ArrayList.java:1259) ~[na:1.8.0_292] at com.alibaba.otter.canal.client.adapter.rdb.service.RdbSyncService.lambda$sync$1(RdbSyncService.java:115) ~[na:na] ... 4 common frames omitted 2021-08-20 03:11:08.045 [Thread-4] ERROR c.a.otter.canal.adapter.launcher.loader.AdapterProcessor - Outer adapter sync failed! Error sync but ACK!

原提问者GitHub用户hyhwl

展开
收起
山海行 2023-04-27 16:06:39 219 0
1 条回答
写回答
取消 提交回答
  • 我找到原因了

    dataSourceKey: defaultDS # 源数据源的key, 对应上面配置的srcDataSources中的值 destination: example # cannal的instance或者MQ的topic groupId: g1 # 对应MQ模式下的groupId, 只会同步对应groupId的数据 outerAdapterKey: mysql1 # adapter key, 对应上面配置outAdapters中的key concurrent: true # 是否按主键hash并行同步, 并行同步的表必须保证主键不会更改及主键不能为其他同步表的外键!! dbMapping: database: sp # 源数据源的database/shcema table: sync_data # 源数据源表名 targetTable: sync_data # 目标数据源的库名.表名 targetPk: # 主键映射 id: id # 如果是复合主键可以换行映射多个 mapAll: true # 是否整表映射, 要求源表和目标表字段名一模一样 etlCondition: "where c_time>={}" commitBatch: 3000

    mapAll: true 这个如果开启 就会报空指针

    targetColumns 还是用这个指明每个字段

    原回答者GitHub用户hyhwl

    2023-04-27 22:06:13
    赞同 展开评论 打赏
问答分类:
SQL
问答地址:
问答排行榜
最热
最新

相关电子书

更多
阿里云MaxCompute百问百答 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载