Re: On the nature of irregular sets

Hi Ugo,

> . . .
> >>Are FlatFields not serializable?
> >
> >They should be. If you are getting an Exception, please
> >send us the stack dump with line numbers.
> >
> DataUtility is saying this:
>
> java.io.NotSerializableException: java.lang.Object
>     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
>     at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
>     at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
>     at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
>     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
>     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
>     at visad.util.DataUtility.isSerializable(DataUtility.java:1454)
>
>
> and forcing a writeObject results in this:
>
> java.io.NotSerializableException: java.lang.Object
>     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
>     at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
>     at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
>     at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
>     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
>     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
>
> The object is a FlatField, displays ok. I can save (serialize) the
> domain set (irregular2d).
>
> visad.jar is the latest.

This is a mystery. I have tried serializing a bunch of FlatFields
by importing various image files into the SpreadSheet, and then
exporting them as "Serialized...", which constructs a VisADForm()
and uses it to serialize the image FlatField. This worked for
GIF files and navigated McIDAS files.

O think the error message:

  java.io.NotSerializableException: java.lang.Object

tells us that the FlatField is not serializable because it
contains (perhaps indirectly) an instance variable declared
as "Object" but without "transient" or "static" (I don't think
static variables are serialized). I cannot find any. One
approach is to try to catch the NotSerializableException in
jdb, and figure out how the offending java.lang.Object is
declared in the FlatField. This can be tricky, as its the
java.io classes that parse the FlatFields various sub-objects.

I'll think about this some more, but if you can make any
progress with jdb that would help.

Cheers,
Bill