开发者

keep getting an ionotseriaizableexception, what did i do wrong?

So, i have a class which has the following attributes

private String name;
private int counter;

private DateFormat df;
private DecimalFormat def;

private ArrayList<Bike> bike;
static String[] titles = {"some,items,here"};

all these are already initializ开发者_运维问答ed and then on top i declared public class Motor extends AbstractTableModel implements Serializable but i still get a IONotSerializableException when i use an ObjectOutputStream, is there some restrictions which i might now know that's why its like this?


All of those fields is serializable, with the possible exception of Bike.

So that means that:

  • Bike is not serializable. Or possibly it is serializable but one of the actual bike object's fields is not fully serializable.
  • There is some other non-serializable field of Motor that you've not shown us.
  • AbstractTableModel or its superclasses have non-serializable fields.

The exception message and full stacktrace should give clues to the real source of the problem.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜