cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Serialization problem
Date Sun, 04 Mar 2012 23:56:16 GMT
You might be right indeed. Cayenne serialization behavior was implemented based on the description
from java.io.Serializable javadocs, which does not mention a call to 'defaultWriteObject'
as required. So it is skipped... Sure enough that has never caused us any problems with the
JDK (there's lots of serialization tests in our unit test suite). 

But of course alternative serialization solutions are free to complain about this behavior,
and that seems to be the case with River marshaller. 

Appreciate if you can open a bug report in Cayenne Jira. I think we can fix it...

Andrus



On Feb 29, 2012, at 7:05 PM, Erlend Birkenes wrote:
> 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


Mime
View raw message