繁体   English   中英

将Apache Camel与基于CXF的RESTful Web服务集成:需要建议

[英]Integrating Apache Camel with CXF based RESTful webservices : Need Advice

我正在尝试将我的CXF静态Web服务与apache骆驼集成。 要求是,当有人点击我的网络服务时,我会获取请求参数并连接到Google或某个服务提供商以使用请求参数搜索结果。 可以说我的网络服务是foo:bar,而我想在此foo:bar被击中后连接到Google。 这意味着我的骆驼路线将是这样的:

     <camelContext>
            <route>
             <to uri:"cxf://bean://foo:bar/>
             <from uri="http://www.google.com"/>
            </route>
           </camelContext>

    is this understanding correct.. 
    i am pasting a section of my config xml for review ..




<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"
// this is the rest uri which is mapped to my resource class 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>

除此之外,我在运行我的Web服务时遇到以下异常:java.lang.ClassNotFoundException:org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java上的org.eclipse.jetty.util.component.Container $ Listener :1666)at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1511)at java.lang.ClassLoader.loadClassInternal(Unknown Source)... 58我不明白我为什么得到这个,因为我使用tomcat进行部署。

解决了这个问题,在我的builpath中添加了所有的跳船罐。 码头版8.0

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM