cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
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 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...


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: Fields were never written
> ...
> Clientside: EOFException: Read past end of file
>     [java]     at
> org.jboss.marshalling.SimpleDataInput.eofOnRead(
>     [java]     at
> org.jboss.marshalling.SimpleDataInput.readUnsignedByteDirect(
>     [java]     at
> org.jboss.marshalling.SimpleDataInput.readUnsignedByte(
>     [java]     at
> org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(
>     [java]     at
> org.jboss.marshalling.river.RiverUnmarshaller.readFields(
>     [java]     at
> org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(
>     [java]     at
> org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(
>     ....
> While googling the problem I came across this issue:
> 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<>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

View raw message