空指针 ERROR c.a.otter.canal.adapter.launcher.loader.AdapterProcessor - java.lang.NullPointerException java.lang.RuntimeException: java.lang.NullPointerException

v1l68za4  于 3个月前  发布在  Java
关注(0)|答案(3)|浏览(86)

Question

环境:
mysql8
cannal 1.1.7
elasticsearch 8.11.3

全量同步一次没有问题,当修改一条记录,增量同步时候,报错了。
yml配置文件如下:
[root@mysql8 canal_adapter]# cat conf/es8/oc_t_order_detail.yml
dataSourceKey: defaultDS
outerAdapterKey: esKey
destination: example
groupId: g1
esMapping:
_index: oc_t_order_detail
_type: _doc
_id: _id
sql: "select order_detail_id as _id, sys_order_id,
order_upload_id, tracking_number, order_detail_status,
order_update_status, lock , order_scan_status,
ship_date_sale, ship_origin_order_id, shop_name,
ship_order_id, ship_first, ship_last, ship_address1,
ship_address2, ship_address3, ship_house_number,
true_track_number, ship_city, ship_state,
ship_zip, ship_country, ship_country_code,
ship_phone, ship_email, ship_warn, quantity,
info, sku, unit_price, product_name, color,
size, category, supplier, remark, inspection_remark,
ship_method, freight, freight_fee, channel_category_fee,
handing_fee, sale_shipping_fee, company_shipping_fee,
ioss_fee, warehouse_in_fee, warehouse_out_fee,
material_fee, flat_fee_weight, sku_total_weight,
weight, lable_weight, bill_weight, material_weight,
declare_fee, track_fee, length, width, height, dws_weight,
dws_length, dws_width, dws_height, date_added, date_modified,
date_split, hide, trash_status,
sent_quantity, customer_id, type, business_type,
inspection, original_tracking_number, sent_email_count, code,
sync_status, sync_count, shipping_flat, shipping_flat_method,
shipping_flat_status, shipping_flat_order_id, shipping_flat_upload_count,
shipping_flat_sync_tracking_count,
shipping_flat_settime, date_printed,
urgent, vat, remote, pieces, vat_payment_method,
ioss_code, pay_status_new, pay_type_new, pay_time_new,
finance_status, split_type, overdraft_status,
stock_status, platform_type, is_frozen,
warehouse_id, usd_rate, usd_to_cny_rate,
is_use_order_materia, plug_in_name,
is_big_order, date_uploaded, date_sent,
opt_user_id, is_pack_task, is_create_big_order,
id_card, warehouses_out_time, freight_fee_cost,
big_order_type, is_zt_order, is_manual_channel,
date_clean_addr_info, order_notes, warehouse_remark,
vat_invoice_fee, is_profit_ok, calc_weight, calc_freight,
oversize_fee, channel_profit, gst_fee, icms_fee from oc_t_order_detail"
etlCondition: "where date_added>={}"
commitBatch: 1000

请问一下,是不是es的版本太高了,要换成es7 ?
报错如下:
2023-12-28 20:48:56.539 [pool-3-thread-1] ERROR c.a.o.canal.client.adapter.es.core.service.ESSyncService - sync error, es index: oc_t_order_detail, DML : Dml
{destination='example', database='dev_cd', table='oc_t_order_detail', type='UPDATE', es=1703766167000, ts=1703767736535, sql='', data=[{order_detail_id=52099
1322396012877, sys_order_id=S520991322396012877, order_upload_id=520991321615872000, tracking_number=, order_detail_status=3, order_update_status=0, lock=0,
order_scan_status=0, ship_date_sale=, ship_origin_order_id=, shop_name=, ship_order_id=4323236, ship_first=mars, ship_last=dfdgf, ship_address1=673335 Tri33p
pel Road666, ship_address2=, ship_address3=, ship_house_number=, true_track_number=, ship_city=553, ship_state=AL, ship_zip=366198, ship_country=US, ship_co
untry_code=US, ship_phone=16019532909, ship_email= 73934610@qq.com , ship_warn=0, quantity=2, info=[{"sku":"SON1","quantity":"2"}], sku=SON1*2, unit_price=11
, product_name=, color=, size=, category=, supplier=, remark=, inspection_remark=, ship_method=CNSZ-YTNDTH, freight=0.0, freight_fee=0.0, channel_category_fe
e=0.0, handing_fee=0.0, sale_shipping_fee=0.0, company_shipping_fee=0.0, ioss_fee=0.0, warehouse_in_fee=0.0, warehouse_out_fee=0.0, material_fee=0.0, flat_fe
e_weight=0, sku_total_weight=0.0, weight=0.0, lable_weight=0.0, bill_weight=0.0, material_weight=0.0, declare_fee=0.0, track_fee=0.0, length=0.0, width=0.0,
height=0.0, dws_weight=0.0, dws_length=0.0, dws_width=0.0, dws_height=0.0, date_added=2023-12-08 15:53:30.0, date_modified=2023-12-08 15:54:01.0, date_split=
null, hide=0, trash_status=0, sent_quantity=0, customer_id=1, type=1, business_type=0, inspection=0, original_tracking_number=, sent_email_count=0, code=, sy
nc_status=0, sync_count=0, shipping_flat=0, shipping_flat_method=, shipping_flat_status=0, shipping_flat_order_id=, shipping_flat_upload_count=0, shipping_fl
at_sync_tracking_count=0, shipping_flat_settime=null, date_printed=null, urgent=0, vat=, remote=0, pieces=1, vat_payment_method=, ioss_code=, pay_status_new=
0, pay_type_new=0, pay_time_new=null, finance_status=0, split_type=0, overdraft_status=0, stock_status=0, platform_type=1, is_frozen=0, warehouse_id=0, usd_r
ate=1.0, usd_to_cny_rate=0.0, is_use_order_materia=0, plug_in_name=EXCEL, is_big_order=0, date_uploaded=null, date_sent=null, opt_user_id=0, is_pack_task=0,
is_create_big_order=0, id_card=, warehouses_out_time=0001-01-03 00:00:00.0, freight_fee_cost=0.0, big_order_type=1, is_zt_order=0, is_manual_channel=0, date_
clean_addr_info=null, order_notes=, warehouse_remark=, vat_invoice_fee=0.0, is_profit_ok=0, calc_weight=0.0, calc_freight=0.0, oversize_fee=0.0, channel_prof
it=0.0, gst_fee=0.0, icms_fee=0.0}], old=[{order_detail_status=10}]}
2023-12-28 20:48:56.539 [pool-3-thread-1] ERROR c.a.otter.canal.adapter.launcher.loader.AdapterProcessor - java.lang.NullPointerException
java.lang.RuntimeException: java.lang.NullPointerException
at com.alibaba.otter.canal.client.adapter.es.core.service.ESSyncService.sync(ESSyncService.java:112)
at com.alibaba.otter.canal.client.adapter.es.core.service.ESSyncService.sync(ESSyncService.java:60)
at com.alibaba.otter.canal.client.adapter.es.core.ESAdapter.sync(ESAdapter.java:104)
at com.alibaba.otter.canal.client.adapter.es.core.ESAdapter.sync(ESAdapter.java:83)
at com.alibaba.otter.canal.client.adapter.ProxyOuterAdapter.sync(ProxyOuterAdapter.java:42)
at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.batchSync(AdapterProcessor.java:139)
at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.lambda$null$1(AdapterProcessor.java:97)
at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:895)
at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.lambda$null$2(AdapterProcessor.java:94)
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: java.lang.NullPointerException: null
at com.alibaba.otter.canal.client.adapter.es8x.support.ES8xTemplate.getESDataFromDmlData(ES8xTemplate.java:318)
at com.alibaba.otter.canal.client.adapter.es.core.service.ESSyncService.singleTableSimpleFiledUpdate(ESSyncService.java:814)
at com.alibaba.otter.canal.client.adapter.es.core.service.ESSyncService.update(ESSyncService.java:208)
at com.alibaba.otter.canal.client.adapter.es.core.service.ESSyncService.sync(ESSyncService.java:97)

2ic8powd

2ic8powd1#

adapter/application.yml,给outerAdapters配置一个key,然后在 es7里 你的 配置文件里 配一个 outerAdapterKey: 。
我也是1.1.7 ,我之前配了下 没问题了。但是 这几天 重启了次 服务 就 又不行了哈哈哈

8qgya5xd

8qgya5xd2#

adapter/application.yml,给outerAdapters配置一个key,然后在 es7里 你的 配置文件里 配一个 outerAdapterKey: 。 我也是1.1.7 ,我之前配了下 没问题了。但是 这几天 重启了次 服务 就 又不行了哈哈哈

我配置了outerAdapterKey 也不行,第一次启动就报空指针。
024-04-25 14:50:57.055 [main] INFO c.a.o.c.client.adapter.es.core.config.ESSyncConfigLoader - ## ES mapping config loaded
2024-04-25 14:50:57.392 [main] INFO c.a.o.canal.adapter.launcher.loader.CanalAdapterLoader - Load canal adapter: es7 succeed
2024-04-25 14:50:57.400 [main] INFO c.alibaba.otter.canal.connector.core.spi.ExtensionLoader - extension classpath dir: /usr/local/canal.adapter-1.1.7/plugin
2024-04-25 14:50:57.413 [main] ERROR c.a.o.canal.adapter.launcher.loader.CanalAdapterService - ## something goes wrong when starting up the canal client adapters:
java.lang.NullPointerException: null
at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.(AdapterProcessor.java:71)
at com.alibaba.otter.canal.adapter.launcher.loader.CanalAdapterLoader.lambda$init$0(CanalAdapterLoader.java:85)
at java.util.HashMap.computeIfAbsent(HashMap.java:1127)
at com.alibaba.otter.canal.adapter.launcher.loader.CanalAdapterLoader.init(CanalAdapterLoader.java:81)

8ftvxx2r

8ftvxx2r3#

请问你的问题解决了吗

相关问题