bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/23026] ObjectInputStream can't deserialize arrays from a


From: marcel dot wiesweg at gmx dot de
Subject: [Bug classpath/23026] ObjectInputStream can't deserialize arrays from a Sun stream
Date: 17 Oct 2005 20:58:44 -0000

If an array is written to an ObjectOutputStream on a Sun JVM, and that stream
is read by an ObjectInputStream on JikesRVM using Classpath 0.16, the read
fails due to a serialVersionUID mismatch.  

Only Sun-to-Classpath fails.  Classpath-to-Classpath and Classpath-to-Sun have
no problems.  

Attached are two files to demonstrate the problem:
% java SaveStrings
using file /tmp/test36196.tmp
% java Loader /tmp/test36196.tmp
read object [Ljava.lang.String;@1cd2e5f
% rvm Loader /tmp/test36196.tmp
Exception in thread "main": java.io.InvalidClassException: class
[Ljava.lang.String;: Local class not compatible: stream
serialVersionUID=-5921575005990323385, local
serialVersionUID=-1262165490042484766
        at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:303)
        at
java.io.ObjectInputStream.readClassDescriptor(ObjectInputStream.java:562)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:228)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:257)
        at Loader.main(Loader.java:19)
JikesRVM.no-pthreads: exit 113


------- Comment #1 from marcel dot wiesweg at gmx dot de  2005-10-17 20:58 
-------
Created an attachment (id=10010)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10010&action=view)
Simple class to reproduce bug

I can confirm this with current SableVM. Attached is a simple class to
reproduce the problem. First run with SUN, then with Classpath. Interestingly,
as the original reporter observed, other direction do not cause the problem.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23026





reply via email to

[Prev in Thread] Current Thread [Next in Thread]