cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CXF-6564) JAXB can't handle interfaces.
Date Thu, 27 Aug 2015 14:54:46 GMT

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

Sergey Beryozkin resolved CXF-6564.
-----------------------------------
       Resolution: Fixed
         Assignee: Sergey Beryozkin
    Fix Version/s: NeedMoreInfo

>  JAXB can't handle interfaces.
> ------------------------------
>
>                 Key: CXF-6564
>                 URL: https://issues.apache.org/jira/browse/CXF-6564
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.1.2
>            Reporter: Abhishek Rawat
>            Assignee: Sergey Beryozkin
>             Fix For: NeedMoreInfo
>
>
> I have this particular payload:
> @XmlRootElement(name = "data")
> @XmlAccessorType(XmlAccess.Field)
> public class ResponsePayload{
> @XmlElement(name = "messages")
> @Setter
> @Getter
> private List<Map.Entry<String,String> messages
> }
> JAXB was working fine for converting the class to json payload with apache cxf 3.1.1.
> But with 3.1.2 it throws the following error:
> Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
> java.util.Map$Entry is an interface, and JAXB can't handle interfaces.
> 	this problem is related to the following location:
> 		at java.util.Map$Entry
> 		at private java.util.List 
> com.ResponsePayload
> 	at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:106)
> 	at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:460)
> 	at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:292)
> 	at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:139)
> 	at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1138)
> 	at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:162)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:497)
> 	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:247)
> 	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:234)
> 	at javax.xml.bind.ContextFinder.find(ContextFinder.java:441)
> 	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:641)
> 	at org.apache.cxf.jaxrs.provider.AbstractJAXBProvider.getClassContext(AbstractJAXBProvider.java:515)
> 	at org.apache.cxf.jaxrs.provider.AbstractJAXBProvider.getJAXBContext(AbstractJAXBProvider.java:497)
> 	at org.apache.cxf.jaxrs.provider.AbstractJAXBProvider.createMarshaller(AbstractJAXBProvider.java:618)
> 	at org.apache.cxf.jaxrs.provider.json.JSONProvider.marshal(JSONProvider.java:622)
> 	at org.apache.cxf.jaxrs.provider.json.JSONProvider.writeTo(JSONProvider.java:393)
> 	... 40 more



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message