Bernhard Mähr created CXF-6656:
----------------------------------
Summary: [Regression] Inheritance of exceptions produces
marshalling problems
Key: CXF-6656
URL: https://issues.apache.org/jira/browse/CXF-6656
Project: CXF
Issue Type: Bug
Affects Versions: 3.1.3
Reporter: Bernhard Mähr
We have services throwing exceptions inherited from super classes.
For example:
{code}
public class MyException extends org.springframework.dao.DataAccessException {
.. }
{code}
Throwing this exception leads to
Caused by: javax.xml.bind.JAXBException: java.lang.Throwable is not known to
this context
at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:613)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.getBeanInfo(UnmarshallerImpl.java:599)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:394)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshallException(JAXBEncoderDecoder.java:582)
The problem is the method getMostSpecificCause returning an object of type
Throwable.
In older versions (2.4.10) the superclasses of the exception were not processed
by JAXBEncoderDecoder.marshallException, only the getters of the actual class.
Now the method Utils.getGetters is used to get the list of getters and it
returns also getters of superclasses.
It is not possible to avoid marshalling of the method getMostSpecificCause with
XmlTransient because even if it is overidden in the actual class,
Utils.getGetters returns the method off the superclass. This is because only
annotations of the method of the superclass are checked.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)