[Top][All Lists]

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

[bug-classpath] [bug #13664] ObjectInputStream can't deserialize arrays

From: anonymous
Subject: [bug-classpath] [bug #13664] ObjectInputStream can't deserialize arrays from a Sun stream
Date: Thu, 7 Jul 2005 03:33:42 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686; en) Opera 8.0


                 Summary: ObjectInputStream can't deserialize arrays from a
Sun stream
                 Project: classpath
            Submitted by: None
            Submitted on: Wed 07/06/2005 at 23:33
                Category: classpath
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
        Platform Version: None



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
        at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:303)
        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


File Attachments:

Date: Wed 07/06/2005 at 23:33  Name: SaveStrings.java  Size: 453B   By: None
uses object serialization to save a String[] to a file


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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