簡體   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