[kaffe] Bug in java.io.NotActiveException: defaultWriteObject called by non-active class and/or object ?

Gérard Basler gerard.basler@starticket.ch
Wed Jan 14 02:39:03 2004


Hi,

>From Sun's Java 1.4 doc:
"This may only be called from the writeObject method of the class being
serialized. It will throw the NotActiveException if it is called
otherwise."

I have a class with the following method:

private void writeObject(java.io.ObjectOutputStream out) throws
IOException
{
        out.defaultWriteObject();
}

This will throw the following exception when run:
java.io.NotActiveException: defaultWriteObject called by non-active
class and/or object
   at java.io.ObjectOutputStream.markFieldsWritten
(ObjectOutputStream.java:448)
   at java.io.ObjectOutputStream.defaultWriteObject
(ObjectOutputStream.java:440)

When I run without any exceptino under the Sun's vm.

I took a look at the code of Kaffe's java classes and it looks like this
doesn't happen if I call writeObject(Object obj) of
ObjectOutputStream.java first.

My question is now:
Is this a bug or not? There doesn't seem to be any obligation to call
writeObject(Object obj) before one can use defaultWriteObject() from
Sun's view.

Thanks for your help.

Gérard