Serialization in Java, invalid type code 00

前端 未结 4 1201
别跟我提以往
别跟我提以往 2020-12-20 18:34

I\'m getting an error (java.io.StreamCorruptedException: invalid type code: 00) when reading in a serialised object. Here is the class that implements serializable:

4条回答
  •  醉话见心
    2020-12-20 18:51

    If the JVM cannot find the class when you attempt to read a serialized object, this exception will be generated. Check that updated jar/class files are available in the class path etc..

    If you're running mallet from the command line, it may be looking at the unzipped mallet jars and class files from a downloaded distribution, and not at your nice new class files created in your downloaded source repository..

    Don't feel too bad - I've seen this happen to others, and have done it myself (though I got a more informative "ClassNotFoundException" to help me figure it out :)

提交回复
热议问题