-
Bug
-
Resolution: Fixed
-
P3
-
8, 9
-
b112
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8156293 | 8u111 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8152414 | 8u102 | Aleksej Efimov | P3 | Resolved | Fixed | b02 |
JDK-8162137 | emb-8u111 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
XJC generates incorrectly annotation @XmlSchemaType for types like:
<!-- Simple type list -->
<xsd:simpleType name="LongList">
<xsd:list>
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedInt"/>
</xsd:simpleType>
</xsd:list>
</xsd:simpleType>
<!--- Complex test type -->
<xsd:element name="typesLongList">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="in" type="tns:LongList"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Follow-up marshalling of incorrectly generated classes triggers ClassCastException at runtime:
java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
at com.sun.xml.internal.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$StringImplImpl.print(RuntimeBuiltinLeafInfoImpl.java:1034)
at com.sun.xml.internal.bind.v2.runtime.reflect.ListTransducedAccessorImpl.print(ListTransducedAccessorImpl.java:103)
at com.sun.xml.internal.bind.v2.runtime.reflect.DefaultTransducedAccessor.writeLeafElement(DefaultTransducedAccessor.java:54)
at com.sun.xml.internal.bind.v2.runtime.property.ListElementProperty.serializeBody(ListElementProperty.java:107)
at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:345)
at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsSoleContent(XMLSerializer.java:578)
at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:326)
at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:479)
at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:313)
at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:241)
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:95)
<!-- Simple type list -->
<xsd:simpleType name="LongList">
<xsd:list>
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedInt"/>
</xsd:simpleType>
</xsd:list>
</xsd:simpleType>
<!--- Complex test type -->
<xsd:element name="typesLongList">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="in" type="tns:LongList"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Follow-up marshalling of incorrectly generated classes triggers ClassCastException at runtime:
java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
at com.sun.xml.internal.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$StringImplImpl.print(RuntimeBuiltinLeafInfoImpl.java:1034)
at com.sun.xml.internal.bind.v2.runtime.reflect.ListTransducedAccessorImpl.print(ListTransducedAccessorImpl.java:103)
at com.sun.xml.internal.bind.v2.runtime.reflect.DefaultTransducedAccessor.writeLeafElement(DefaultTransducedAccessor.java:54)
at com.sun.xml.internal.bind.v2.runtime.property.ListElementProperty.serializeBody(ListElementProperty.java:107)
at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:345)
at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsSoleContent(XMLSerializer.java:578)
at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:326)
at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:479)
at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:313)
at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:241)
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:95)
- backported by
-
JDK-8152414 JAXB marshaller fails with ClassCastException on classes generated by xjc
- Resolved
-
JDK-8156293 JAXB marshaller fails with ClassCastException on classes generated by xjc
- Resolved
-
JDK-8162137 JAXB marshaller fails with ClassCastException on classes generated by xjc
- Resolved
- relates to
-
JDK-8150174 Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
- Resolved