【问题标题】:Integrating Apache Camel with CXF based RESTful webservices : Need Advice将 Apache Camel 与基于 CXF 的 RESTful Web 服务集成:需要建议
【发布时间】:2012-04-24 13:20:38
【问题描述】:

我正在尝试将我的 CXF RESTful Web 服务与 Apache Camel 集成。要求是当有人点击我的网络服务时,我获取请求参数并连接到谷歌或某些服务提供商以使用请求参数搜索结果。 假设我的网络服务是 foo:bar 并且我想在这个 foo:bar 被命中后连接到谷歌。 这意味着我的骆驼路线会是这样的:

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

除此之外,当我运行我的网络服务时,我遇到了以下异常: java.lang.ClassNotFoundException: org.eclipse.jetty.util.component.Container$Listener 在 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1666) 在 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1511) 在 java.lang.ClassLoader.loadClassInternal(未知来源) ... 58 更多 我不明白为什么我会得到这个,因为我正在使用 tomcat 进行部署。

【问题讨论】:

  • 我已经记录了一个 JIRA,所以我们将来会提供一个开箱即用的 Apache Camel 分发示例:issues.apache.org/jira/browse/CAMEL-5203
  • 感谢克劳斯......现在它可以工作了......我添加了我可以在网上找到的所有码头罐子(8.0版)......
  • 您可以将自己的问题标记为已回答吗?

标签: java spring cxf apache-camel cxfrs


【解决方案1】:

解决了这个问题,在我的构建路径中添加了所有的码头罐子。码头版本 8.0

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-09-24
    • 2016-12-31
    • 2015-09-03
    • 1970-01-01
    • 1970-01-01
    • 2013-07-14
    • 1970-01-01
    • 2012-08-16
    相关资源
    最近更新 更多