Anonymous | Login | Signup for a new account | 11-21-2024 10:48 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | |||||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
0006392 | [Hessian] | minor | always | 04-16-21 06:23 | 10-30-23 02:24 | |||||||
Reporter | garsonchan | View Status | public | |||||||||
Assigned To | ||||||||||||
Priority | normal | Resolution | open | |||||||||
Status | new | Product Version | 4.0.63 | |||||||||
Summary | 0006392: Hessian can not support a class with a filed which is LocalDate when serializing | |||||||||||
Description |
We get an "StackOverflow Exception" while trying to serialize a class with a field which is LocalDate. We create a small testcase to reproduce the bug. The testcase uses JavaSerializer and Hessian2Output to serialize a class A, which has a field called a_filed. We finally find that JavaSerializer would use java.time.LocalDate#writeReplace to serialize LocalDate,which returns an object of java.time.Ser.The class of java.time.Ser has a field ,which is the object of LocalDate that class A has(a_filed). So when JavaSerializer serialzes class A, it would use writeObject and cause an endless loop between serialzing a_filed and the object of java.time.Ser that java.time.LocalDate#writeReplace returns. |
|||||||||||
Additional Information |
The Exception stack is below: Exception in thread "main" java.lang.StackOverflowError at com.caucho.hessian.io.SerializerFactory.getSerializer(SerializerFactory.java:260) at com.caucho.hessian.io.SerializerFactory.getObjectSerializer(SerializerFactory.java:217) at com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:463) at com.caucho.hessian.io.UnsafeSerializer$ObjectFieldSerializer.serialize(UnsafeSerializer.java:299) at com.caucho.hessian.io.UnsafeSerializer.writeInstance(UnsafeSerializer.java:218) at com.caucho.hessian.io.UnsafeSerializer.writeObject(UnsafeSerializer.java:172) at com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:465) at com.caucho.hessian.io.WriteReplaceSerializer.writeObject(WriteReplaceSerializer.java:167) at com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:465) at com.caucho.hessian.io.UnsafeSerializer$ObjectFieldSerializer.serialize(UnsafeSerializer.java:299) at com.caucho.hessian.io.UnsafeSerializer.writeInstance(UnsafeSerializer.java:218) at com.caucho.hessian.io.UnsafeSerializer.writeObject(UnsafeSerializer.java:172) at com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:465) at com.caucho.hessian.io.WriteReplaceSerializer.writeObject(WriteReplaceSerializer.java:167) at com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:465) at com.caucho.hessian.io.UnsafeSerializer$ObjectFieldSerializer.serialize(UnsafeSerializer.java:299) ... |
|||||||||||
Attached Files | A.java [^] (607 bytes) 04-16-21 06:23 | |||||||||||
|
There are no notes attached to this issue. |
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
46 total queries executed. 31 unique queries executed. |