本文介绍了在创建一个骆驼Drools的路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到以下错误,而使用Drools的骆驼组成部分部署骆驼的路线。
这是我的路线的样子。
<路线ID =Drools的路由>
<从URI =直接:Drools的-EP/>
<政策REF =droolsPolicy>
<解组REF =XStream的/>
<到URI =Drools的:节点1 / ksession1/>
<元帅REF =XStream的/>
< /政策与GT;
< /路由> <豆的id =droolsPolicy级=org.drools.camel.component.DroolsPolicy/>268 [HTTP-BIO-8080-EXEC-5] SpringCamelContext信息Apache的骆驼2.10快照(CamelContext:camelctx)开始
269 [HTTP-BIO-8080-EXEC-5] SpringCamelContext信息跟踪上CamelContext启用:camelctx
270 [HTTP-BIO-8080-EXEC-5] ManagementStrategyFactory信息JMX启用。
271 [HTTP-BIO-8080-EXEC-5] ultManagementLifecycleStrategy信息StatisticsLevel在所有所以启用负载性能统计信息
272 [HTTP-BIO-8080-EXEC-5] DefaultTypeConverter信息加载194型转换器
273 [HTTP-BIO-8080-EXEC-5] SpringCamelContext信息Apache的骆驼2.10快照(CamelContext:camelctx)正在关闭
274 [HTTP-BIO-8080-EXEC-5] SpringCamelContext信息Apache的骆驼2.10快照(CamelContext:camelctx)是0.004秒关机。运行时间0.298秒。
275 [HTTP-BIO-8080-EXEC-5]的ContextLoader错误上下文初始化失败
276 org.apache.camel.RuntimeCamelException:org.apache.camel.FailedToCreateRouteException:无法在打造航线Drools的路由:>>>政策[参考:droolsPolicy]<<<在路线:路线[从[直接:Drools的-EP] - > [策略[参考:droolsPolicy]] ...因为无法解析端点:Drools的://节点1 / ksession1由于:找不到GridNode在CamelContext URI =节点1 / ksession1。检查配置。
在277 org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1221)[camel-core-2.10-20120318.032230-65.jar:2.10-SNAPSHOT]
278 org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)[camel-spring-2.10-20120318.032739-65.jar:2.10-SNAPSHOT]
在279种org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:243)[camel-spring-2.10-20120318.032739-65.jar:2.10-SNAPSHOT]
在280 org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
281在org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
282 org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
在283 org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
在284 org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)[spring-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
在285 org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)[spring-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
在286 org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)[spring-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
在287 org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)[catalina.jar:7.0.26]
在288 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)[catalina.jar:7.0.26]
289在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)[catalina.jar:7.0.26]
290 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)[catalina.jar:7.0.26]
291在org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)[catalina.jar:7.0.26]
292 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)[catalina.jar:7.0.26]
293在org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958)[catalina.jar:7.0.26]
294在org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:536)[catalina.jar:7.0.26]
295在org.apache.catalina.startup.HostConfig.check(HostConfig.java:1467)[catalina.jar:7.0.26]
296 sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法):1.6.0_29]
297在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39):1.6.0_29]
298在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25):1.6.0_29]
299在java.lang.reflect.Method.invoke(Method.java:597):1.6.0_29]
在300 org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)[tomcat-coyote.jar:7.0.26]
在301 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)[:1.6.0_29]
302 com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761):1.6.0_29]
303 org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1436)[catalina.jar:7.0.26]
304 org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:673)[catalina.jar:7.0.26]
305在org.apache.catalina.manager.ManagerServlet.doPut(ManagerServlet.java:431)[catalina.jar:7.0.26]
306 javax.servlet.http.HttpServlet.service(HttpServlet.java:644)的servlet-api.jar文件:]
307 javax.servlet.http.HttpServlet.service(HttpServlet.java:722)的servlet-api.jar文件:]
308 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)[catalina.jar:7.0.26]
在309 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)[catalina.jar:7.0.26]
310 org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)[catalina.jar:7.0.26]
在311 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)[catalina.jar:7.0.26]
312 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)[catalina.jar:7.0.26]
在313 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)[catalina.jar:7.0.26]
314 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)[catalina.jar:7.0.26]
315 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)[catalina.jar:7.0.26]
316在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)[catalina.jar:7.0.26]
317 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)[catalina.jar:7.0.26]
318 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)[catalina.jar:7.0.26]
在319 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)[catalina.jar:7.0.26]
320在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)[catalina.jar:7.0.26]
321 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)[tomcat-coyote.jar:7.0.26]
322 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)[tomcat-coyote.jar:7.0.26]
323 org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)[tomcat-coyote.jar:7.0.26]
324在java.util.concurrent.ThreadPoolExecutor中$ Worker.runTask(ThreadPoolExecutor.java:886):1.6.0_29]
325在java.util.concurrent.ThreadPoolExecutor中$ Worker.run(ThreadPoolExecutor.java:908):1.6.0_29]
326在java.lang.Thread.run(Thread.java:680):1.6.0_29]
327 2012年3月19日下午12点23分17秒org.apache.catalina.core.StandardContext startInternal
解决方案
Spring配置的例子:
< Drools的:网格节点ID =节点1/>< Drools的:kbase ID =AccountingKBase节点=节点1>
< Drools的:资源>
< Drools的:资源类型=DTABLE
来源=类路径:规则/ AccountingPeriods.xls/>
< / Drools的:资源>
< / Drools的:kbase>
< Drools的:ksession ID =AccountingKSessionNAME =AccountingKSession
键入=无状态kbase =AccountingKBase节点=节点1/> <骆驼:路线ID =accountingRulesRoute>
<骆驼:从URI =直接:accountingRulesRoute/>
<骆驼:到URI =Drools的:节点1 / AccountingKSession/>
< /骆驼:路线>
I'm getting the following error while deploying a Camel route using the drools-camel component.
This is how my route looks like.
<route id="drools-route">
<from uri="direct:drools-ep" />
<policy ref="droolsPolicy">
<unmarshal ref="xstream" />
<to uri="drools:node1/ksession1" />
<marshal ref="xstream" />
</policy>
</route>
<bean id="droolsPolicy" class="org.drools.camel.component.DroolsPolicy" />
268 [ http-bio-8080-exec-5] SpringCamelContext INFO Apache Camel 2.10-SNAPSHOT (CamelContext: camelctx) is starting
269 [ http-bio-8080-exec-5] SpringCamelContext INFO Tracing is enabled on CamelContext: camelctx
270 [ http-bio-8080-exec-5] ManagementStrategyFactory INFO JMX enabled.
271 [ http-bio-8080-exec-5] ultManagementLifecycleStrategy INFO StatisticsLevel at All so enabling load performance statistics
272 [ http-bio-8080-exec-5] DefaultTypeConverter INFO Loaded 194 type converters
273 [ http-bio-8080-exec-5] SpringCamelContext INFO Apache Camel 2.10-SNAPSHOT (CamelContext: camelctx) is shutting down
274 [ http-bio-8080-exec-5] SpringCamelContext INFO Apache Camel 2.10-SNAPSHOT (CamelContext: camelctx) is shutdown in 0.004 seconds. Uptime 0.298 seconds.
275 [ http-bio-8080-exec-5] ContextLoader ERROR Context initialization failed
276 org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route drools-route at: >>> Policy[ref:droolsPolicy] <<< in route: Route[[From[direct:drools-ep]] -> [Policy[ref:droolsPolicy] ]... because of Failed to resolve endpoint: drools://node1/ksession1 due to: Could not find GridNode for uri="node1/ksession1" in CamelContext. Check configuration.
277 at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1221)[camel-core-2.10-20120318.032230-65.jar:2.10-SNAPSHOT]
278 at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)[camel-spring-2.10-20120318.032739-65.jar:2.10-SNAPSHOT]
279 at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:243)[camel-spring-2.10-20120318.032739-65.jar:2.10-SNAPSHOT]
280 at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
281 at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
282 at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
283 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
284 at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)[spring-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
285 at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)[spring-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
286 at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)[spring-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
287 at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)[catalina.jar:7.0.26]
288 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)[catalina.jar:7.0.26]
289 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)[catalina.jar:7.0.26]
290 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)[catalina.jar:7.0.26]
291 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)[catalina.jar:7.0.26]
292 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)[catalina.jar:7.0.26]
293 at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958)[catalina.jar:7.0.26]
294 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:536)[catalina.jar:7.0.26]
295 at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1467)[catalina.jar:7.0.26]
296 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_29]
297 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_29]
298 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_29]
299 at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_29]
300 at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)[tomcat-coyote.jar:7.0.26]
301 at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)[:1.6.0_29]
302 at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)[:1.6.0_29]
303 at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1436)[catalina.jar:7.0.26]
304 at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:673)[catalina.jar:7.0.26]
305 at org.apache.catalina.manager.ManagerServlet.doPut(ManagerServlet.java:431)[catalina.jar:7.0.26]
306 at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)[servlet-api.jar:]
307 at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)[servlet-api.jar:]
308 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)[catalina.jar:7.0.26]
309 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)[catalina.jar:7.0.26]
310 at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)[catalina.jar:7.0.26]
311 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)[catalina.jar:7.0.26]
312 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)[catalina.jar:7.0.26]
313 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)[catalina.jar:7.0.26]
314 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)[catalina.jar:7.0.26]
315 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)[catalina.jar:7.0.26]
316 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)[catalina.jar:7.0.26]
317 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)[catalina.jar:7.0.26]
318 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)[catalina.jar:7.0.26]
319 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)[catalina.jar:7.0.26]
320 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)[catalina.jar:7.0.26]
321 at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)[tomcat-coyote.jar:7.0.26]
322 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)[tomcat-coyote.jar:7.0.26]
323 at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)[tomcat-coyote.jar:7.0.26]
324 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_29]
325 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_29]
326 at java.lang.Thread.run(Thread.java:680)[:1.6.0_29]
327 Mar 19, 2012 12:23:17 PM org.apache.catalina.core.StandardContext startInternal
解决方案
Example of Spring configuration:
<drools:grid-node id="node1" />
<drools:kbase id="AccountingKBase" node="node1">
<drools:resources>
<drools:resource type="DTABLE"
source="classpath:rules/AccountingPeriods.xls" />
</drools:resources>
</drools:kbase>
<drools:ksession id="AccountingKSession" name="AccountingKSession"
type="stateless" kbase="AccountingKBase" node="node1" />
<camel:route id="accountingRulesRoute">
<camel:from uri="direct:accountingRulesRoute" />
<camel:to uri="drools:node1/AccountingKSession" />
</camel:route>
这篇关于在创建一个骆驼Drools的路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!