Mantis - Hessian
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
6392 | minor | always | 04-16-21 06:23 | 10-30-23 02:24 | |
|
|||||
Reporter: | garsonchan | Platform: | |||
Assigned To: | OS: | ||||
Priority: | normal | OS Version: | |||
Status: | new | Product Version: | 4.0.63 | ||
Product Build: | Resolution: | open | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | |||
|
|||||
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. |
||||
Steps To Reproduce: | |||||
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) ... |
||||
Relationships | |||||
Attached Files: | A.java [^] (607 bytes) 04-16-21 06:23 |
There are no notes attached to this issue. |