-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
1.4.0
-
sparc
-
solaris_7
Execute the following code and you should get the following error message. It seems to be only happening on Solaris sparc.
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 TestSerialize.serializeAndDeserialize(TestSerialize.java:29)
at TestSerialize.<init>(TestSerialize.java:16)
at TestSerialize.main(TestSerialize.java:9)
--------------------------------------------------------------
import java.io.*;
import javax.swing.*;
import javax.swing.table.*;
public class TestSerialize {
public static void main(String[] args) {
new TestSerialize();
}
public TestSerialize() {
Object target = new JFormattedTextField();
try {
serializeAndDeserialize(target);
} catch(Exception e) {
e.printStackTrace();
}
System.exit(0);
}
private Object serializeAndDeserialize(Object toWrite)
throws ClassNotFoundException, IOException {
FileOutputStream fos = new FileOutputStream("cereal.dat");
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(toWrite);
oos.flush();
fos.close();
FileInputStream fis = new FileInputStream("cereal.dat");
ObjectInputStream ois = new ObjectInputStream(fis);
Object retVal = ois.readObject();
fis.close();
return retVal;
}
}
--------------------------------------------------------------
edmund.lou@eng 2000-11-27
Swing Test Developer
======================================
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 TestSerialize.serializeAndDeserialize(TestSerialize.java:29)
at TestSerialize.<init>(TestSerialize.java:16)
at TestSerialize.main(TestSerialize.java:9)
--------------------------------------------------------------
import java.io.*;
import javax.swing.*;
import javax.swing.table.*;
public class TestSerialize {
public static void main(String[] args) {
new TestSerialize();
}
public TestSerialize() {
Object target = new JFormattedTextField();
try {
serializeAndDeserialize(target);
} catch(Exception e) {
e.printStackTrace();
}
System.exit(0);
}
private Object serializeAndDeserialize(Object toWrite)
throws ClassNotFoundException, IOException {
FileOutputStream fos = new FileOutputStream("cereal.dat");
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(toWrite);
oos.flush();
fos.close();
FileInputStream fis = new FileInputStream("cereal.dat");
ObjectInputStream ois = new ObjectInputStream(fis);
Object retVal = ois.readObject();
fis.close();
return retVal;
}
}
--------------------------------------------------------------
edmund.lou@eng 2000-11-27
Swing Test Developer
======================================
- duplicates
-
JDK-4392283 java.lang.reflect.AccessibleObject.setAccessible() broken in merlin B42
-
- Closed
-