尝试序列化时捕获异常
我的日志中出现以下错误
[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 replicate attribute changeBankStatusForm
我已识别出引发此错误的对象,该对象很大,很多属性包含它们自身属性
如何识别引发序列化错误的确切属性
谢谢
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 replicate 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更新看来您的应用程序服务器错误地处理了异常,因此您必须手动查看所有字段并检查它们的类型是否实现
Serialized
您很可能正在处理你的例外错误。我假设你正在做:
如果是这样的话 - 你无法获得更多信息,因为你已经吞下了异常。您应该调用
ex.printStackTrace()
(或使用日志框架),然后异常会告诉您哪个类未能序列化,因此您将能够将其标记为
Serializable< /代码>
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:
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