我想創建駱駝簡單的路線,從靜止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駱駝駱駝運行:運行我收到以下錯誤
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).....
可有人請讓我知道我錯了,爲什麼緩存豆是不是被created..I我對這個錯誤感到失望。 在此先感謝。
嗨侯賽因,您的回覆我檢查我下面的POM由於是項 <依賴性> \t \t \t \t \t org.apache.camel \t \t \t 駱駝核心 個\t \t \t $ {camel.version} \t \t \t \t \t \t \t org.apache.camel \t \t \t 駱駝彈簧 \t \t \t $ {駱駝。版本} \t \t 和使用的版本蔭是 2.10.3 –
Sayan