You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2017/10/30 19:35:00 UTC

[jira] [Commented] (CAMEL-11967) Restlet binding should not create jaxb marshaller when binding mode is set to json

    [ https://issues.apache.org/jira/browse/CAMEL-11967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16225612#comment-16225612 ] 

Claus Ibsen commented on CAMEL-11967:
-------------------------------------

Thanks John, would you like to try to submit this patch as a github PR (pull request), then its easier for us to apply

There is a link from here with some points how to do that
http://camel.apache.org/contributing

And there is also plenty of other resources online about how to work with github and do PRs

> Restlet binding should not create jaxb marshaller when binding mode is set to json
> ----------------------------------------------------------------------------------
>
>                 Key: CAMEL-11967
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11967
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core, rest
>    Affects Versions: 2.20.0
>            Reporter: john
>            Priority: Minor
>             Fix For: 2.20.1, 2.21.0
>
>
> The following rest endpoint fails with jaxb exception:
> {code:java}
> .get("/getAllEndpoints").bindingMode(RestBindingMode.json).outType(Map.class)
>         			.to("bean:IRWebServiceRegistry?method=getAllProperties");
> {code}
> {code:java}
> Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
> java.util.Map is an interface, and JAXB can't handle interfaces.
> {code}
> This is fine if i wanted to marshall to xml but i specifically set binding mode to json.
> Fix:
> Change this line:
> https://github.com/apache/camel/blob/36039c0563dfe9e04527c5eca1058e66326054ee/camel-core/src/main/java/org/apache/camel/model/rest/RestBindingDefinition.java#L174
> To: 
> if (jaxb != null && (mode.contains("xml") || mode.equals(RestBindingMode.auto))) {
> May want to consider doing the same for the json section at line 130



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)