I have been trying to send the JSON request made to the Activemq queue using camel-cxf component for exposing the RESTful service. Below is my route code:
<route>
<from uri="cxfrs:bean:rsServer" />
<log message="${body}"/>
<to uri="activemq:queue:testQueue" pattern="InOnly" />
</route>
where rsServer is the RESTful service exposed.
<cxf:rsServer id="rsServer" address="/services"
serviceClass="com.mayank.restservice.resource.RestfulResource">
<cxf:providers>
<bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" />
<bean class="org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider" />
</cxf:providers>
<cxf:extensionMappings>
<entry key="xml" value="application/xml" />
<entry key="json" value="application/json" />
</cxf:extensionMappings>
</cxf:rsServer>
On calling web service Activemq does receive item in queue but on viewing the message:
javax.jms.JMSException: Failed to build body from content. Serializable class not available to broker. Reason: java.lang.ClassNotFoundException: org.apache.cxf.message.MessageContentsList
is shown. Please tell what can be the issue as I am completely new to camel.