Re: Serializing problems. Help appreciated.
Lothar Kimmeringer wrote:
Since you ignore exception occuring while serializing the Universe,
there most likely is an exception happening.
Lew wrote:
Why do you say he ignores exceptions? His code doesn't, and we have
no direct evidence that the programmer does.
Lothar Kimmeringer wrote:
try
{
uni=new Universe();
fos = new FileOutputStream(filename);
out = new ObjectOutputStream(fos);
out.writeObject(uni);
out.close();}
catch(IOException ex)
{
ex.printStackTrace();
}
If you catch the exception without doing anything, you ignore
it by definition.
He is doing something about it, therefore he is not ignoring it, by
definition.
He's logging the result and exiting the block..
Lew wrote:
OTOH, we have no evidence that the programmer is looking at the stderr
output either. OP, please tell us what the stack trace shows, or at
least whether it shows..
Lothar Kimmeringer wrote:
I already asked that in the text you quoted:
Yes, you did, and I quoted you:
Is something printed
out in STDERR?
Lothar Kimmeringer wrote:
Check for an exception happening when calling writeObject. Most
likely in one of the nested members you try to serialize a non-
transient member that is not serializable.
Lew wrote:
This is where an SSCCE can help us help the OP.
Lothar Kimmeringer wrote:
A SSCCE is unnecessary if there is an exception with an explaining
message. Serialization-problems are not big magic.
An SSCCE can help us help the OP.
Since we don't see the message, and even if we did we don't see the
code to which it refers, it's very difficult to diagnose what's
wrong. An SSCCE can help us help the OP.
--
Lew