You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
反序列化的结果为:Person{name='test1', age=10}
java.lang.NullPointerException
at com.alibaba.fastjson.parser.deserializer.DefaultFieldDeserializer.parseField(DefaultFieldDeserializer.java:51)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.parseField(JavaBeanDeserializer.java:689)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.deserialze(JavaBeanDeserializer.java:570)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.deserialze(JavaBeanDeserializer.java:189)
at com.alibaba.fastjson.parser.deserializer.DefaultFieldDeserializer.parseField(DefaultFieldDeserializer.java:60)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.deserialze(JavaBeanDeserializer.java:549)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.deserialze(JavaBeanDeserializer.java:189)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.deserialze(JavaBeanDeserializer.java:185)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseObject(DefaultJSONParser.java:355)
at com.alibaba.fastjson.parser.DefaultJSONParser.parse(DefaultJSONParser.java:1309)
at com.alibaba.fastjson.parser.DefaultJSONParser.parse(DefaultJSONParser.java:1275)
at com.alibaba.fastjson.JSON.parse(JSON.java:178)
at com.alibaba.fastjson.JSON.parse(JSON.java:162)
at tesla.client.test.json.JsonSerializer.deserialize(JsonSerializer.java:49)
at tesla.client.test.json.JsonSerialTest.serialTest(JsonSerialTest.java:34)
at tesla.client.test.json.JsonSerialTest.main(JsonSerialTest.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
环境说明:
jdk:1.8
fastjson:1.2.21
能够重现的case程序如下:
序列化执行类
程序输出结果如下:
反序列化的结果为:Person{name='test1', age=10}
java.lang.NullPointerException
at com.alibaba.fastjson.parser.deserializer.DefaultFieldDeserializer.parseField(DefaultFieldDeserializer.java:51)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.parseField(JavaBeanDeserializer.java:689)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.deserialze(JavaBeanDeserializer.java:570)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.deserialze(JavaBeanDeserializer.java:189)
at com.alibaba.fastjson.parser.deserializer.DefaultFieldDeserializer.parseField(DefaultFieldDeserializer.java:60)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.deserialze(JavaBeanDeserializer.java:549)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.deserialze(JavaBeanDeserializer.java:189)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.deserialze(JavaBeanDeserializer.java:185)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseObject(DefaultJSONParser.java:355)
at com.alibaba.fastjson.parser.DefaultJSONParser.parse(DefaultJSONParser.java:1309)
at com.alibaba.fastjson.parser.DefaultJSONParser.parse(DefaultJSONParser.java:1275)
at com.alibaba.fastjson.JSON.parse(JSON.java:178)
at com.alibaba.fastjson.JSON.parse(JSON.java:162)
at tesla.client.test.json.JsonSerializer.deserialize(JsonSerializer.java:49)
at tesla.client.test.json.JsonSerialTest.serialTest(JsonSerialTest.java:34)
at tesla.client.test.json.JsonSerialTest.main(JsonSerialTest.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
请@wenshao 帮忙查看,非常感谢!!
The text was updated successfully, but these errors were encountered: