Details
-
Bug
-
Resolution: Fixed
-
P1
-
8
-
b124
-
Verified
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8031488 | 9 | Iaroslav Savytskyi | P1 | Closed | Fixed | b02 |
JDK-8032125 | 8u20 | Alan Bateman | P1 | Closed | Fixed | b01 |
JDK-8032411 | 8u5 | Alan Bateman | P1 | Resolved | Fixed | b05 |
Description
The JCK tests for the serialization of the j.x.b.TypeConstraintException starts to fail for jdk8b112:
api/javax_xml/bind/TypeConstraintException/serial/index.html#Input: Failed. test cases: 3; all failed; first test case failure: serial2008
http://moonblade.ru.oracle.com/set/java/jck/qa-results/jck/8/ea/b34/results/qac/1136_failed/jtReport/failed.html
Serialized byte output of the j.x.b.TypeConstraintException instance is in the attached file TCE.ser.
TCE.ser was created with jdk8b111.
Minimized test should be run with jdk8b112 and later:
--------------------------------------------------------------------------------------
public class SerTest {
public static void main(String[] args) throws IOException, ClassNotFoundException {
// ser("D:\\TCE.ser", new TypeConstraintException("msg"));
deser("D:\\TCE.ser");
}
private static void ser(String fName, Serializable lambda) throws IOException {
try (ObjectOutputStream ostream = new ObjectOutputStream(new FileOutputStream(fName))) {
ostream.writeObject(lambda);
}
}
private static Object deser(String fName) throws IOException, ClassNotFoundException {
System.out.println("Deserialized object from '" + fName + "':");
try (ObjectInputStream istream = new ObjectInputStream(new FileInputStream(fName))) {
Object o = istream.readObject();
System.out.println(o.getClass());
return o;
}
}
}
--------------------------------------------------------------------------------------
Output:
--------------------------------------------------------------------------------------
Exception in thread "main" java.io.InvalidClassException: javax.xml.bind.TypeConstraintException; local class incompatible: stream classdesc serialVersionUID = -3059799699420143848, local class serialVersionUID = -8953627615972140042
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:621)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1621)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1516)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1772)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1349)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
at SerTest.deser(SerTest.java:26)
at SerTest.main(SerTest.java:14)
--------------------------------------------------------------------------------------
api/javax_xml/bind/TypeConstraintException/serial/index.html#Input: Failed. test cases: 3; all failed; first test case failure: serial2008
http://moonblade.ru.oracle.com/set/java/jck/qa-results/jck/8/ea/b34/results/qac/1136_failed/jtReport/failed.html
Serialized byte output of the j.x.b.TypeConstraintException instance is in the attached file TCE.ser.
TCE.ser was created with jdk8b111.
Minimized test should be run with jdk8b112 and later:
--------------------------------------------------------------------------------------
public class SerTest {
public static void main(String[] args) throws IOException, ClassNotFoundException {
// ser("D:\\TCE.ser", new TypeConstraintException("msg"));
deser("D:\\TCE.ser");
}
private static void ser(String fName, Serializable lambda) throws IOException {
try (ObjectOutputStream ostream = new ObjectOutputStream(new FileOutputStream(fName))) {
ostream.writeObject(lambda);
}
}
private static Object deser(String fName) throws IOException, ClassNotFoundException {
System.out.println("Deserialized object from '" + fName + "':");
try (ObjectInputStream istream = new ObjectInputStream(new FileInputStream(fName))) {
Object o = istream.readObject();
System.out.println(o.getClass());
return o;
}
}
}
--------------------------------------------------------------------------------------
Output:
--------------------------------------------------------------------------------------
Exception in thread "main" java.io.InvalidClassException: javax.xml.bind.TypeConstraintException; local class incompatible: stream classdesc serialVersionUID = -3059799699420143848, local class serialVersionUID = -8953627615972140042
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:621)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1621)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1516)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1772)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1349)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
at SerTest.deser(SerTest.java:26)
at SerTest.main(SerTest.java:14)
--------------------------------------------------------------------------------------
Attachments
Issue Links
- backported by
-
JDK-8032411 serialVersionUID of javax.xml.bind.TypeConstraintException accidently changed
- Resolved
-
JDK-8031488 serialVersionUID of javax.xml.bind.TypeConstraintException accidently changed
- Closed
-
JDK-8032125 serialVersionUID of javax.xml.bind.TypeConstraintException accidently changed
- Closed