java流中的可序列化或串行版本

时间:2012-10-12 13:24:23

标签: java serialization objectoutputstream serialversionuid

为什么我收到此错误?虽然我已经设置了串行版本,但我无法完成我的工作。实际上我试图从objectoutputstream读取。我需要来自对象输出流的imageicon数据,并且我在该行收到错误。我想要做什么?

我收到错误的行是:

  1. ImageIcon imageIcon =(ImageIcon)cObjectInputStream.readObject();
  2. java.io.InvalidClassException:javax.swing.ImageIcon;当地班级     不兼容:stream classdesc serialVersionUID =     -962022720109015502,本地类serialVersionUID = 532615968316031794 at     java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)         在     java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)         在     java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)         在     java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)         在     java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)         在     remoteserver.ClientScreenReciever.run(ClientScreenReciever.java:34)

0 个答案:

没有答案