Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.5, 2.0.6
-
None
Description
@AutoExternalize doesn't create a no-argument constructor, which is required to use Externalizable.
>javap -classpath .;c:\Users\Johann\.m2\repository\org\codehaus\groovy\groovy\2.0.5\groovy-2.0.5.jar xyz.Stream | grep Stream Compiled from "Stream.groovy" public final class xyz.Stream implements java.io.Externalizable,groovy.lang.GroovyObject { public xyz.Stream(java.util.HashMap); public xyz.Stream(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Int eger, java.lang.Integer, java.lang.Long); >
Consequently, attempts at deserializing fail:
classOrInstanceShouldBeSerializable[2](xyz.SerializationTest) Time elapsed: 0.016 sec <<< ERROR! org.apache.commons.lang.SerializationException: java.io.InvalidClassException: xyz.Stream; no valid consuctor at org.apache.commons.lang.SerializationUtils.deserialize(SerializationUtils.java:168) ... Caused by: java.io.InvalidClassException: xyz.Stream; no valid constructor at java.io.ObjectStreamClass$ExceptionInfo.newInvalidClassException(ObjectStreamClass.java:147) at java.io.ObjectStreamClass.checkDeserialize(ObjectStreamClass.java:755) ...