0

私はキャメルで簡単なルートを作成しようとしています。残りの 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).....

Can someone please let me know where I am wrong and why the cache bean is not being created..I am at loss with this error. Thanks in advance.

4

2 に答える 2

0

ラクダのバージョンを 2.12.1 に変更した後、正常に動作するようになりました..

于 2013-10-18T16:06:37.477 に答える