开发者

How to handle Java.io.NotSerializableException

开发者 https://www.devze.com 2023-01-25 00:18 出处:网络
I have created a java program which works with java I/O. I have implemented Serializable interface, but it still cause java.io.NotSerializableException on the following part of my code while I am tryi

I have created a java program which works with java I/O. I have implemented Serializable interface, but it still cause java.io.NotSerializableException on the following part of my code while I am trying to write objects into a file:

         oos.writeObject(ep);

How it is possible while I am implementing serializable? should I do another works besides 开发者_运维知识库implementing this interface?


Usually that means, that another object that your object you are trying to serialize holds a reference to is not serializable. If you post your code and the exceptions stacktrace it would be a lot easier to tell.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号