我开始使用scala DSL并且非常喜欢它。
我目前有一个混合java和scala的项目。
我在java中有正确的事务处理。
如果我尝试使用scala进行交易路由,则无法启动驼峰上下文。
以下是未启动的示例路线:
"amq:queue:myQueue" ==> {
routeId("myTransactedRoute")
transacted("JMS_PROPAGATION_REQUIRED")
-->("log:foo")
}
其中“JMS_PROPAGATION_REQUIRED”是我的交易策略,适用于java。
我做错了吗?
org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route myTransactedRoute at: >>> From[amq:queue:myQueue] <<< in route: Route(myTransactedRoute)[[From[amq:queue:myQueue... because of Route myTransactedRoute has no output processors. You need to add outputs to the route such as to("log:foo").
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1619) ~[camel-core-2.15.2.jar:2.15.2]
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:123) ~[camel-spring-2.15.2.jar:2.15.2]
at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:332) ~[camel-spring-2.15.2.jar:2.15.2]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151) ~[spring-context-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128) ~[spring-context-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331) ~[spring-context-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773) ~[spring-context-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483) ~[spring-context-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) ~[spring-web-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) ~[spring-web-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [spring-web-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210) [catalina.jar:6.0.41]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709) [catalina.jar:6.0.41]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) [catalina.jar:6.0.41]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) [catalina.jar:6.0.41]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583) [catalina.jar:6.0.41]
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1429) [catalina.jar:6.0.41]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_11]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_11]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_11]
at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_11]
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297) [tomcat-coyote.jar:6.0.41]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) [na:1.8.0_11]
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) [na:1.8.0_11]
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:631) [catalina.jar:6.0.41]
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:568) [catalina.jar:6.0.41]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_11]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_11]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_11]
at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_11]
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:295) [tomcat-coyote.jar:6.0.41]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) [na:1.8.0_11]
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) [na:1.8.0_11]
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1466) [na:1.8.0_11]
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) [na:1.8.0_11]
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307) [na:1.8.0_11]
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1399) [na:1.8.0_11]
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:828) [na:1.8.0_11]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_11]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_11]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_11]
at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_11]
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323) [na:1.8.0_11]
at sun.rmi.transport.Transport$1.run(Transport.java:178) [na:1.8.0_11]
at sun.rmi.transport.Transport$1.run(Transport.java:175) [na:1.8.0_11]
at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_11]
at sun.rmi.transport.Transport.serviceCall(Transport.java:174) [na:1.8.0_11]
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:557) [na:1.8.0_11]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:812) [na:1.8.0_11]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:671) [na:1.8.0_11]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_11]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_11]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_11]
引起:org.apache.camel.FailedToCreateRouteException:无法在以下位置创建路径myTransactedRoute:&gt;&gt;&gt;来自[amq:queue:myQueue]&lt;&lt;&lt;在路线中:路线(myTransactedRoute)[[来自[amq:queue:myQueue ...因为路线myTransactedRoute没有输出处理器。您需要向路径添加输出,例如to(“log:foo”)。 在org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1019)〜[camel-core-2.15.2.jar:2.15.2] 在org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:185)〜[camel-core-2.15.2.jar:2.15.2] at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:841)~ [camel-core-2.15.2.jar:2.15.2] at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:2895)~ [camel-core-2.15.2.jar:2.15.2] 在org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2618)〜[camel-core-2.15.2.jar:2.15.2] 在org.apache.camel.impl.DefaultCamelContext.access $ 000(DefaultCamelContext.java:167)〜[camel-core-2.15.2.jar:2.15.2] 在org.apache.camel.impl.DefaultCamelContext $ 2.call(DefaultCamelContext.java:2467)~ [camel-core-2.15.2.jar:2.15.2] 在org.apache.camel.impl.DefaultCamelContext $ 2.call(DefaultCamelContext.java:2463)〜[camel-core-2.15.2.jar:2.15.2] 在org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2486)〜[camel-core-2.15.2.jar:2.15.2] 在org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2463)〜[camel-core-2.15.2.jar:2.15.2] 在org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)〜[camel-core-2.15.2.jar:2.15.2] 在org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2432)〜[camel-core-2.15.2.jar:2.15.2] 在org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:255)〜[camel-spring-2.15.2.jar:2.15.2] 在org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:121)〜[camel-spring-2.15.2.jar:2.15.2] ...省略了51个常见帧 引起:java.lang.IllegalArgumentException:路由amq-asyncCrmPrintConfirm没有输出处理器。您需要向路径添加输出,例如to(“log:foo”)。 在org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1017)〜[camel-core-2.15.2.jar:2.15.2] ...省略了64个常见帧
答案 0 :(得分:0)
在仔细查看代码之后,我发现了一些看起来像故障的东西,我正在测试并且如果有效则会执行拉取请求。