我的老師給我提供了serilaized文件..而deserilaizing文件作爲例外,說我獲得以下錯誤錯誤而deserializeing .dat文件
java.io.InvalidClassException: netflix.memreader.FeatureWriter; local class incompatible: stream classdesc serialVersionUID = 3279065858639389501, local class serialVersionUID = -7190666486441488760
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at netflix.memreader.FeatureWriter.deserialize(FeatureWriter.java:327)
at netflix.memreader.MemReader.readFeaturesFromMem(MemReader.java:811)
at netflix.memreader.MemReader.main(MemReader.java:727)
Exception in thread "main" java.lang.NullPointerException
at netflix.memreader.MemReader.readFeaturesFromMem(MemReader.java:814)
at netflix.memreader.MemReader.main(MemReader.java:727)
這裏是代碼公共靜態FeatureWriter反序列化(字符串文件名){{嘗試FIS的FileInputStream =新的FileInputStream(文件名); \t \t ObjectInputStream in = new ObjectInputStream(fis); \t \t \t \t return(FeatureWriter)in.readObject(); \t // deserilize到memReader類 \t \t \t \t} \t \t \t \t捕捉(ClassNotFoundException的E){ \t \t的System.out.println( 「找不到類」); \t \t e.printStackTrace(); }(IOException e){System.out.println(「IO error」);}}}}}}}}}}}} e.printStackTrace(); } – 2014-10-31 05:59:58
將您的代碼添加到您的文章(使用*編輯*)。 – 2014-10-31 06:01:49
包括問題本身的代碼t – arghtype 2014-10-31 06:01:56