-
1. Re: Works in 3.0.2. 3.2.1 MessageFormatException: Object can
adrian.brock Jul 22, 2003 5:57 AM (in response to andrewboyd)Marking something as Serializable only
declares an intention.
e.g.
public class MyClass implements Serializable
{
public ArrayList list;
}
This looks ok, until you do:
list.add(new Object());
The MyClass is no longer serializable because Object
is not Serializable.
There are other reasons why the object might be
serialized. Try running your object instance through
this code to see whether you get a more informative
IOException:
ByteArrayOutputStream byteArray = new ByteArrayOutputStream();
ObjectOutputStream objectOut = new ObjectOutputStream( byteArray );
objectOut.writeObject( object );
objectOut.close();
Regards,
Adrian -
2. Re: Works in 3.0.2. 3.2.1 MessageFormatException: Object can
andrewboyd Jul 23, 2003 1:45 PM (in response to andrewboyd)Thanks Adrian,
Turns out we put in Log4J and it wasn't Serializable
java.io.NotSerializableException: org.apache.log4j.Logger
Your code pointed it out right away.
Thanks again,
Andrew