【问题标题】:Error in camel route骆驼路线错误
【发布时间】:2013-10-18 14:36:42
【问题描述】:

我正在尝试在camel中创建一个简单的路由,从rest uri接收消息并将消息存储在缓存中,我已经完成了以下操作

我的路线如下

<camel:endpoint id="fooCache1" uri="cache:TestCache1"/>  <camel:from uri="cxfrs://bean://rsServer" />
        <camel:to uri="log:output?showAll=true" />
        <camel:to uri="bean:payProcessor" />
        <camel:to uri="direct:start" />
        </camel:route>
               <camel:route>
    <camel:from uri="direct:start" />   
    <camel:setHeader headerName="CamelCacheOperation">
            <camel:constant>CamelCacheAdd</camel:constant>
        </camel:setHeader>
        <camel:setHeader headerName="CamelCacheKey">
            <camel:constant>myCache</camel:constant>
        </camel:setHeader>
     <camel:to  ref="fooCache1"/>
<camel:to uri="log:output?showAll=true" />
     </camel:route>

当尝试通过 mvn camel:run 在骆驼上运行它时,我收到以下错误

   Error occurred while running main from: org.apache.camel.spring.Main
    java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:440)
            at java.lang.Thread.run(Thread.java:724)
    Caused by: org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCrea
    teRouteException: Failed to create route route2 at: >>> To[ref:fooCache1] <<< in
     route: Route[[From[direct:start]] -> [SetHeader[CamelCacheOperation... because
    of org.springframework.beans.factory.BeanCreationException: Error creating bean
    with name 'fooCache1': FactoryBean threw exception on object creation; nested ex
    ception is java.lang.NoSuchMethodError: org.apache.camel.util.ObjectHelper.notNu
    ll(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
            at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHe
    lper.java:1271)
            at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringC
    amelContext.java:120)
            at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(Ca
    melContextFactoryBean.java:280)
            at org.springframework.context.event.SimpleApplicationEventMulticaster.m
    ulticastEvent(SimpleApplicationEventMulticaster.java:97)
            at org.springframework.context.support.AbstractApplicationContext.publis
    hEvent(AbstractApplicationContext.java:303).....

谁能告诉我我错在哪里以及为什么没有创建缓存 bean..我对这个错误不知所措。 提前致谢。

【问题讨论】:

    标签: maven apache-camel fuseesb jbossfuse


    【解决方案1】:

    检查骆驼弹簧和骆驼核心组件的版本,您的情况似乎存在兼容性问题。使用相同版本的两个库。

    【讨论】:

    • 嗨 Hussain,谢谢你的回复 我检查了我的 pom 下面是条目 org.apache.camelcamel-core artifactId> ${camel.version}org.apache.camelcamel-spring${camel .version} 并且我使用的版本是 2.10.3
    【解决方案2】:

    将骆驼版本更改为 2.12.1 后,它现在可以正常工作了..

    【讨论】:

      猜你喜欢
      • 2018-09-05
      • 2021-11-04
      • 2011-05-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多