-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
1.4.0
-
None
-
x86
-
solaris_7
Serialization of some classes (FILE, URL etc) throws exception.
-------- Test.java ---------
import java.io.*;
class Test implements java.io.Serializable {
public static void main (String argv[]) {
try {
FileOutputStream ostream = new FileOutputStream("t.tmp");
ObjectOutputStream p = new ObjectOutputStream(ostream);
p.writeInt(12345);
p.writeObject("Today");
p.writeObject(new File("Test.java"));
p.flush();
ostream.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
------------------------------
% java -version
java version "1.4.0beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0beta-b42)
Java HotSpot(TM) Client VM (build 1.4beta-B42, mixed mode)
% java Test
Exception in thread "main" java.lang.InternalError: Unable to access writeObject method
at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1895)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1210)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at Test.main(Test.java:12)
--------------
Fails in build B-42. Works fine with build-B41
-------- Test.java ---------
import java.io.*;
class Test implements java.io.Serializable {
public static void main (String argv[]) {
try {
FileOutputStream ostream = new FileOutputStream("t.tmp");
ObjectOutputStream p = new ObjectOutputStream(ostream);
p.writeInt(12345);
p.writeObject("Today");
p.writeObject(new File("Test.java"));
p.flush();
ostream.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
------------------------------
% java -version
java version "1.4.0beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0beta-b42)
Java HotSpot(TM) Client VM (build 1.4beta-B42, mixed mode)
% java Test
Exception in thread "main" java.lang.InternalError: Unable to access writeObject method
at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1895)
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1210)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at Test.main(Test.java:12)
--------------
Fails in build B-42. Works fine with build-B41
- duplicates
-
JDK-4392283 java.lang.reflect.AccessibleObject.setAccessible() broken in merlin B42
-
- Closed
-