You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Bernhard Mähr (JIRA)" <ji...@apache.org> on 2016/03/01 13:21:18 UTC

[jira] [Updated] (CXF-6656) [Regression] Inheritance of exceptions produces marshalling problems

     [ https://issues.apache.org/jira/browse/CXF-6656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bernhard Mähr updated CXF-6656:
-------------------------------
    Affects Version/s: 3.1.5

> [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, 3.1.5
>            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)