why I'm getting NotSerializableException exception though I've implemented 'Serializable'

后端 未结 3 450
抹茶落季
抹茶落季 2021-01-28 12:18

I\'ve implemented Serializable in class \'userInfo\'. Still I\'m getting exception. Here\'s the output console -

java.io.WriteAbortedException: writing aborted;         


        
3条回答
  •  执念已碎
    2021-01-28 12:19

    Without seeing your code, it's hard to know for sure, but the cause of this is almost always that your class has a field that is not serializable (or that contains an object that contains a field, ...). Everything in an object, including everything that the object references and everything that those objects reference, must be serializable to avoid the exception.

提交回复
热议问题