Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2235

Exception when UDF object contains nonSerializable field

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.0
    • 2.5.0
    • None
    • None

    Description

      While we check if UDF classes are serializable, we don't check if the initialized UDF object is serializable, which can lead to the below exception when compiling. We should do a check during UDF initialization to see if it's serializable and error out if it's not.

                                                                                                                                                                                                                       java.io.IOException: unexpected exception type
              at java.io.ObjectStreamClass.throwMiscException(ObjectStreamClass.java:1736)
              at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1146)
              at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
              at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
              at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
              at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
              at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:441)
              at org.apache.daffodil.util.PreSerialization.serializeObject(Serialize.scala:46)
              at org.apache.daffodil.util.PreSerialization.serializeObject$(Serialize.scala:42)
              at org.apache.daffodil.dsom.DPathCompileInfo.serializeObject(CompiledExpression1.scala:202)
              at org.apache.daffodil.dsom.DPathCompileInfo.writeObject(CompiledExpression1.scala:229)
      ....
      Caused by: org.apache.daffodil.exceptions.Abort: Could not serialize member of class com.example.NonSerializableClass, found within class ElementRuntimeData
      org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:129)
      org.apache.daffodil.util.PreSerialization.serializeObject(Serialize.scala:49)
      org.apache.daffodil.util.PreSerialization.serializeObject$(Serialize.scala:42)
      org.apache.daffodil.processors.TermRuntimeData.serializeObject(RuntimeData.scala:99)
              at org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:129)
              at org.apache.daffodil.util.PreSerialization.serializeObject(Serialize.scala:49)
              at org.apache.daffodil.util.PreSerialization.serializeObject$(Serialize.scala:42)
              at org.apache.daffodil.processors.TermRuntimeData.serializeObject(RuntimeData.scala:99)
              at org.apache.daffodil.processors.ElementRuntimeData.writeObject(RuntimeData.scala:741)
              at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
      
      
      
      

      Attachments

        Activity

          People

            dfthompson Dave Thompson
            okilo@tresys.com Olabusayo Kilo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: