-
Bug
-
Resolution: Done
-
Major
-
jbossws-1.0.2
-
None
There is a problem with the marshalling of their web service response message if a complex type contains an element which contains an anonymous simple type with restriction. E.g: -
<complexType name='TelephoneNumber'>
<sequence>
<element name='areaCode' nillable='true'>
<simpleType>
<restriction base='string'>
<pattern value='[0-9]
'/>
</restriction>
</simpleType>
</element>
<element name='number' nillable='true' type='string'/>
</sequence>
</complexType>
This causes a NullPointerException because the class MarshallerImpl is expecting the type to have a QName.
java.lang.NullPointerException
at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalSimpleType(MarshallerImpl.java:458)
at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalElementType(MarshallerImpl.java:415)
at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalElement(MarshallerImpl.java:331)
at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalElementOccurence(MarshallerImpl.java:311)
at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalParticle(MarshallerImpl.java:730)
at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalModelGroupSequence(MarshallerImpl.java:920)
at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalModelGroup(MarshallerImpl.java:860)
at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalParticle(MarshallerImpl.java:641)
at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalComplexType(MarshallerImpl.java:608)
at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalElementType(MarshallerImpl.java:419)
at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalElement(MarshallerImpl.java:331)
at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalElementOccurence(MarshallerImpl.java:311)
at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshallInternal(MarshallerImpl.java:210)
at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshal(MarshallerImpl.java:168)
at org.jboss.ws.jaxb.JBossXBMarshallerImpl.marshal(JBossXBMarshallerImpl.java:146)
at org.jboss.ws.jaxrpc.encoding.JAXBSerializer.serialize(JAXBSerializer.java:107)
Looking at the marshalSimpleType method of the MarshallerImpl class the QName of the type is used to check if it is QName or NOTATION, checking that the QName is set before using it appears to fix this problem.
Second the method marshalCharacters also makes use of the QName of the type to check if the namespace of the type is the schema namespace.
- is blocked by
-
JBWS-1199 Upgrade to JBossXB CR7
- Closed