Hi
I'm trying to serialize my Cayenne entities using JBoss Marshaller, but I
get the following errors (keeping them short as the details are not
important, see further explanation below):
Serverside: java.io.NotActiveException: Fields were never written
...
Clientside: EOFException: Read past end of file
[java] at
org.jboss.marshalling.SimpleDataInput.eofOnRead(SimpleDataInput.java:126)
[java] at
org.jboss.marshalling.SimpleDataInput.readUnsignedByteDirect(SimpleDataInput.java:263)
[java] at
org.jboss.marshalling.SimpleDataInput.readUnsignedByte(SimpleDataInput.java:224)
[java] at
org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
[java] at
org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1677)
[java] at
org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1593)
[java] at
org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1235)
....
While googling the problem I came across this issue:
https://issues.jboss.org/browse/JBMAR-67 indicating what the problem might
be.
I checked the Cayenne source and CayenneDataObject do indeed implement
private void writeObject(ObjectOutputStream stream), but does NOT call
defaultWriteObject or writeFields and I think this is the problem.
According to this<http://docs.oracle.com/javase/6/docs/platform/serialization/spec/output.html#861>writeObject
MUST call defaultWriteObject or writeFields once. Is this a bug
in Cayenne or is this actually intentional? Or am I misunderstanding what
is happening here?
I've searched in Jira, but can't find anything related to this. Has anyone
experienced this problem before, and is there a way around this?
-Erlend