0
我正在尝试将CXF宁静的Web服务与Apache Camel集成。我得到以下异常时,我将请求发送到我的web服务:TypeConversion例外:Apache Camel和CXF
Caused by: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.cxf.message.MessageContentsList to the required type: java.io.InputStream with value [null]
at org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:147)
at org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:100)
... 68 more
我贴我的配置XML的部分进行审查:
<jaxrs:server id="restContainer" address="/" staticSubresourceResolution="true">
<jaxrs:serviceBeans>
<ref bean="FooBar"/>
</jaxrs:serviceBeans>
<jaxrs:providers>
<bean class="org.apache.cxf.jaxrs.provider.JSONProvider">
<property name="dropRootElement" value="true"/>
<property name="supportUnwrapped" value="true"/>
</jaxrs:providers>
<camelcxf:rsServer id="rsServer" address="http://localhost:port/MyApplication/rest/foobar" serviceClass="com.camel.example.FooBar"/>
<camel:camelContext id="camelContext-1">
<camel:route>
<camel:from uri="cxfrs:bean:rsServer"/>
<camel:to uri="http://www.google.com"/>
</camel:route>
</camel:camelContext>
尝试在你的spring配置文件中加入这个。 –
2012-04-21 20:42:00
我已经在myconfig xml中使用了这个。 – Sikorski 2012-04-22 06:08:18
您使用的是哪种版本的Camel和CXF?看起来来自CXF的消息是空的(空),因此类型转换失败。你在你的RS服务上发布了什么? – 2012-04-22 06:45:06