ClassCastException when Appending Object OutputStream

后端 未结 3 2035
伪装坚强ぢ
伪装坚强ぢ 2020-12-09 14:00

I have been trying to do a little project that needs an appendable ObjectOutputStream. I have gone through a couple of solutions and i found this It seemed to solve my probl

3条回答
  •  情歌与酒
    2020-12-09 14:13

    No clear answer for you, but some thoughts and things to try:

    • The stack trace includes at java.util.ArrayList.readObject(Unknown Source), which indicates the problem occurs while deserializing a class containing an ArrayList. Narrow your problem down by commenting out the private ArrayList transactions;

    • Do you have the same problem if you generate a single file without using your appender? If so, create two forms of the same content: one with appender, one without. Diffs?

    • I do see one other reference to a similar problem, no solution. Also uses the same appender: Serialization/deserialization ClassCastException: x cannot be cast to java.io.ObjectStreamClass

提交回复
热议问题