Hi,

As far as I understand this is because of there is no default json provider
for jaxrs in cxf. (for xml messages there is jaxb as default)
I could be able to solve this issue by defining a provider for json, and
giving this definition on my rest endpoint.

in maven:

            <dependency>
                <groupId>org.codehaus.jackson</groupId>
                <artifactId>jackson-jaxrs</artifactId>
                <version>1.9.13</version>
            </dependency>

and if you use spring boot define a bean as follows,

        @Bean
        public org.codehaus.jackson.jaxrs.JacksonJsonProvider jsonProvider(){
                JacksonJsonProvider jsonProvider = new JacksonJsonProvider();
                return jsonProvider;
        }

and then you can define your rest endpoint as follow,

private static final String REST_ENDPOINT_URI =
"cxfrs:///servlet/rest?resourceClasses=com.example.CustomerOperations&*providers=#jsonProvider
*



--
View this message in context: 
http://camel.465427.n5.nabble.com/ERROR-No-message-body-reader-has-been-found-for-class-ContentType-application-json-in-CXF-JAXRS-2-173-tp5786940p5787008.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to