JPPF Issue Tracker
star_faded.png
Please log in to bookmark issues
bug_report_small.png
CLOSED  Bug report JPPF-597  -  JPPF serialization fails with java.time.* classes
Posted Jul 27, 2019 - updated Jul 27, 2019
icon_info.png This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Bug report
  • Status
     
    Closed
  • Assigned to
     lolo4j
  • Progress
       
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     lolo4j
  • Owned by
    Not owned by anyone
  • Category
    Core
  • Resolution
    RESOLVED
  • Priority
    Normal
  • Reproducability
    Always
  • Severity
    Normal
  • Targetted for
    icon_milestones.png JPPF 6.1.2
Issue description
Using JPPF serialization (org.jppf.serialization.DefaultJPPFSerialization) to serialize/deserialize instances of classes in java.time.* packages results in exceptions like the following:
java.io.IOException
  at org.jppf.serialization.JPPFObjectInputStream.readObjectOverride(JPPFObjectInputStream.java:96)
  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:425)
  at org.jppf.serialization.DefaultJPPFSerialization.deserialize(DefaultJPPFSerialization.java:81)
  at test.time.DateTimeSerialization.copyObject(DateTimeSerialization.java:81)
  at test.time.DateTimeSerialization.main(DateTimeSerialization.java:55)
Caused by: java.lang.reflect.InvocationTargetException
  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:498)
  at org.jppf.serialization.Deserializer.readFields(Deserializer.java:180)
  at org.jppf.serialization.Deserializer.readObject(Deserializer.java:142)
  at org.jppf.serialization.Deserializer.readObject(Deserializer.java:112)
  at org.jppf.serialization.JPPFObjectInputStream.readObjectOverride(JPPFObjectInputStream.java:92)
  ... 4 more
Caused by: java.io.InvalidObjectException: Deserialization via serialization delegate
  at java.time.LocalDate.readObject(LocalDate.java:2066)
  ... 12 more
Steps to reproduce this issue
try to serialize a LocalDateTime object with JPPF serialization:
LocalDateTime localDateTime = LocalDateTime.now();
JPPFSerialization ser = new DefaultJPPFSerialization();
try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) {
  ser.serialize(object, os);
}