Caught Exception while trying to serialize
I've the following error in my logs
[6/6/11 17:16:33:558 CEST] 00000005 WASSession E MTMBuffWrapper storeObject SESN0200E: Caught Exception while trying to serialize.
[6/6/11 17:16:33:558 CEST] 00000005 WASSession E MTMHashMap handlePropertyHits SESN0202E: Failed to replica开发者_如何学JAVAte attribute changeBankStatusForm
I've identified the object which raise this error, this object is huge, a lot of attribute containing them self attributes
How can I identify the exact attribute which raise the serialization error
Thanks
Update it appears that your application server is handling the exception wrongly, so you'd have to manually look through all fields and check if their types implement Serializable
You are most likely handling your exception wrong. I assume you are doing:
try { ..
} catch(Exception ex) {
System.out.println("Caught Exception while trying to serialize"); // wrong
ex.printStackTrace(); // better
logger.error("Serialization problem", ex); //best
}
If that's the case - you can't get any more info, because you've swallowed the exception. You should call ex.printStackTrace()
instead (or use a logging framework)
Then the exception will tell you which class fails the serialization, and so you will be able to mark it as Serializable
精彩评论