2012-04-20 69 views
0

我正在嘗試將我的CXF restful web服務與apache駱駝集成。要求是當有人點擊我的web服務時,我接受請求參數並連接到google或某個服務提供者,以使用請求參數搜索結果。 可以說我的webservice是foo:bar,並且我想在這個foo:bar命中後連接到google。 這意味着我的駱駝路線是這樣的事情:將Apache Camel與基於CXF的RESTful web服務集成:需要建議

 <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.eclipse.jetty.util.component .Container $監聽 在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1666) 在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1511) 在java.lang中。 ClassLoader.loadClassInternal(Unknown Source) ... 58更多 我不明白爲什麼我得到這個,因爲我使用tomcat進行部署。

+0

我已經登錄了一個JIRA,所以我們將來會用Apache Camel發行版提供一個開箱即用的示例:https://issues.apache.org/jira/browse/CAMEL-5203 – 2012-04-22 06:55:11

+0

謝謝Claus ...現在它的工作..我添加了所有的碼頭罐子,我可以找到網絡(版本8.0).. – Sikorski 2012-04-23 13:48:56

+0

你可以標記自己的問題,因爲你已經得到它的答案,你得到它的工作。 – 2012-04-24 03:45:36

回答

0

解決了這個問題,在我的建築物中添加了所有的碼頭罐。 jetty version 8.0