I have a vector which is shared between multiple threads and when I try to read from this vector using one of these threads, I got a StreamCorruptedException.
Here is the stacktrace of the exception:
java.io.StreamCorruptedException: invalid stream header: 7371007E
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:801)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:298)
at prj.ReadThread.run(ReadThread.java:32
The line of code that make this exception in prj.ReadThread.run is
ObjectInputStream o = new ObjectInputStream(RS.getInputStream());
If more information is needed please tell me.
The exception appears to be thrown in
readStreamHeader(), which you can step through in your debugger. I suspect a version number mismatch. Many classes include a Warning: Serialized objects of this class will not be compatible with future Xxx releases.Addendum: @S Kh helpfully reports the following: