-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.4.1
-
x86
-
windows_xp
Name: rmT116609 Date: 10/30/2002
FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
FULL OPERATING SYSTEM VERSION :Microsoft Windows XP
[Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
JTextField cant be serialized when JTextField instance is containing Japanese characters.
import java.io.*;
import javax.swing.*;
public class Test {
public static void main(String[] args) throws Exception {
JTextField ta = new JTextField("ã??"); // Japanese Character
ObjectOutputStream out = new ObjectOutputStream(System.out);
out.writeObject(ta);
out.close();
}
}
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile and run the code
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.io.NotSerializableException: java.lang.Object
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at java.util.Hashtable.writeObject(Hashtable.java:801)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeWriteObject
(ObjectStreamClass.java:795)
at java.io.ObjectOutputStream.writeSerialData
(ObjectOutputStream.java:1294)
at java.io.ObjectOutputStream.writeOrdinaryObject
(ObjectOutputStream.java:1245)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at java.io.ObjectOutputStream.defaultWriteFields
(ObjectOutputStream.java:1330)
at java.io.ObjectOutputStream.writeSerialData
(ObjectOutputStream.java:1302)
at java.io.ObjectOutputStream.writeOrdinaryObject
(ObjectOutputStream.java:1245)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at java.io.ObjectOutputStream.defaultWriteFields
(ObjectOutputStream.java:1330)
at java.io.ObjectOutputStream.writeSerialData
(ObjectOutputStream.java:1302)
at java.io.ObjectOutputStream.writeOrdinaryObject
(ObjectOutputStream.java:1245)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at Test.main(Test.java:17)
REPRODUCIBILITY :
This bug can be reproduced always.
(Review ID: 166410)
======================================================================
- duplicates
-
JDK-4770950 A bug of javax.swing.JTextField
- Resolved