Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5864

@AutoExternalize doesn't create no-argument constructor

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.5, 2.0.6
    • Fix Version/s: 2.3.0-beta-1
    • Component/s: xforms
    • Labels:
      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)
      ...
      

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              johann Johann
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: