Details
Description
JAXBElementProvider line 170 - 176:
This piece of code performs a special handling for classes, which extends JAXBElement but it calls the wrong unmarshal method.
Unmarshaller.unmarshal(Source source, Class<?> declaredType)
Unmarshaller.unmarshal(XMLStreamReader reader, Class<?> declaredType)
Unmarshaller.unmarshal(XMLEventReader reader, Class<?> declaredType)
Unmarshaller.unmarshal(Node node, Class<?> declaredType)
These methods are not able to deal with classes, which extend JAXBElement, because they explicitly check, if the declaredType is part of the known classes of the JAXBContext. This is not the case.
Please use the other methods instead.
Suggested solution: Change
response = unmarshaller.unmarshal(TransformUtils.createNewReaderIfNeeded(reader, is), theType);
to
response = unmarshaller.unmarshal(TransformUtils.createNewReaderIfNeeded(reader, is));