xuxueli / xxl-job

A distributed task scheduling framework.(分布式任务调度平台XXL-JOB)
http://www.xuxueli.com/xxl-job/
GNU General Public License v3.0
27.46k stars 10.86k forks source link

注册失败 #2141

Open Zmy999 opened 3 years ago

Zmy999 commented 3 years ago

c.x.j.c.thread.ExecutorRegistryThread : >>>>>>>>>>> xxl-job registry fail, registryParam:RegistryParam{registryGroup='EXECUTOR', registryKey='oriPlan-Job', registryValue='http://192.168.43.55:9998/'}, registryResult:ReturnT [code=500, msg=xxl-rpc remoting (url=http://127.0.0.1:8922/job-admin/api/registry)

response content invalid

同时还搭配这个错误:

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226) ~[gson-2.8.5.jar:na] at com.google.gson.Gson.fromJson(Gson.java:927) ~[gson-2.8.5.jar:na] at com.google.gson.Gson.fromJson(Gson.java:892) ~[gson-2.8.5.jar:na] at com.google.gson.Gson.fromJson(Gson.java:841) ~[gson-2.8.5.jar:na] at com.xxl.job.core.util.GsonTool.fromJson(GsonTool.java:53) ~[xxl-job-core-2.2.0.jar:na] at com.xxl.job.core.util.XxlJobRemotingUtil.postBody(XxlJobRemotingUtil.java:131) ~[xxl-job-core-2.2.0.jar:na] at com.xxl.job.core.biz.client.AdminBizClient.registry(AdminBizClient.java:42) [xxl-job-core-2.2.0.jar:na] at com.xxl.job.core.thread.ExecutorRegistryThread$1.run(ExecutorRegistryThread.java:48) [xxl-job-core-2.2.0.jar:na] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_241] Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385) ~[gson-2.8.5.jar:na] at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:215) ~[gson-2.8.5.jar:na] ... 8 common frames omitted

有没有大佬帮看下

cygmris commented 3 years ago

This issue is cause by customized Serializer on your spring lifecycle chain with BeanSerializerModifier which replce null with String or the other non-null value . Check it out.

    @JsonSerialize(nullsUsing = NullSerializer.class)
    private T content;
Tiangel commented 3 years ago

@cygmris Gson no this annotation @JsonSerialize(nullsUsing = NullSerializer.class)