6 Replies Latest reply on Dec 2, 2011 10:16 AM by kcbabo

    Classloader problem with DLS route to jms queue

    atgnatus

      Hi,

       

      I am having a problem with a DSL route.  I have tried several different approaches and verified all the queues and services but routing to a jms queue causes org.apache.camel.component.jms.JmsBinding.getJMSMessageTypeForBody to throw a java.lang.ClassNotFoundException: org.w3c.dom.Node.

       

      My route looks like this:

       

      @Route(Router.class)

      public class RouterBean extends RouteBuilder {

         

          public void configure() {

              from("switchyard://Router")

                  .log("+++ Message received in RouterBean Route")

                  .log("${body}")

                  .to("jms:GreetingServiceQueue?connectionFactory=#ConnectionFactory")

      //            .to("switchyard://SinkOne")

                  .to("switchyard://SinkTwo");

          }

      }

       

      GreetingServiceQueue routes to SinkOne.  When I send a message to it directly, SinkOne service fires correctly.

       

      Here's the stack trace followed by my switchyard.xml.

       

      Thanks AGAIN for all your help!

       

      ++++++++++++++++++++++++

       

      10:31:20,198 ERROR [org.apache.camel.processor.DefaultErrorHandler] (RMI TCP Connection(2)-127.0.0.1) Failed delivery for exchangeId: ID-chris-PC-50016-1322764265872-1-1. Exhausted after delivery attempt: 1 caught: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: From SourceBean:java.lang.String]: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: From SourceBean:java.lang.String]

          at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1161) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:287) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:290) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:109) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.processor.Pipeline.process(Pipeline.java:116) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.processor.Pipeline.process(Pipeline.java:79) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85) [camel-core-2.8.0.jar:2.8.0]

          at org.switchyard.component.camel.SwitchYardConsumer.invokeCamelProcessor(SwitchYardConsumer.java:74) [switchyard-component-camel-0.3.0.CR1.jar:0.3.0.CR1]

          at org.switchyard.component.camel.SwitchYardConsumer.handleMessage(SwitchYardConsumer.java:63) [switchyard-component-camel-0.3.0.CR1.jar:0.3.0.CR1]

          at org.switchyard.internal.DefaultHandlerChain.handleMessage(DefaultHandlerChain.java:132) [switchyard-runtime-0.3.0.CR1.jar:0.3.0.CR1]

          at org.switchyard.internal.DefaultHandlerChain.handle(DefaultHandlerChain.java:107) [switchyard-runtime-0.3.0.CR1.jar:0.3.0.CR1]

          at org.switchyard.internal.LocalDispatcher.dispatch(LocalExchangeBus.java:72) [switchyard-runtime-0.3.0.CR1.jar:0.3.0.CR1]

          at org.switchyard.internal.ExchangeImpl.sendInternal(ExchangeImpl.java:253) [switchyard-runtime-0.3.0.CR1.jar:0.3.0.CR1]

          at org.switchyard.internal.ExchangeImpl.send(ExchangeImpl.java:176) [switchyard-runtime-0.3.0.CR1.jar:0.3.0.CR1]

          at org.switchyard.component.bean.ClientProxyBean$ClientProxyInvocationHandler.invoke(ClientProxyBean.java:317) [switchyard-component-bean-0.3.0.CR1.jar:0.3.0.CR1]

          at $Proxy33.doRoute(Unknown Source)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]

          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]

          at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:48) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

          at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

          at org.jboss.weld.proxies.Router$1366014918$Proxy$_$$_WeldClientProxy.doRoute(Router$1366014918$Proxy$_$$_WeldClientProxy.java) [weld-core-1.1.2.Final.jar:]

          at com.example.switchyard.routerTest.SourceBean.sendData(SourceBean.java:18) [routerTest-0.0.1-SNAPSHOT.jar:]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]

          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]

          at org.switchyard.component.bean.ServiceProxyHandler.handle(ServiceProxyHandler.java:126) [switchyard-component-bean-0.3.0.CR1.jar:0.3.0.CR1]

          at org.switchyard.component.bean.ServiceProxyHandler.handleMessage(ServiceProxyHandler.java:81) [switchyard-component-bean-0.3.0.CR1.jar:0.3.0.CR1]

          at org.switchyard.internal.DefaultHandlerChain.handleMessage(DefaultHandlerChain.java:132) [switchyard-runtime-0.3.0.CR1.jar:0.3.0.CR1]

          at org.switchyard.internal.DefaultHandlerChain.handle(DefaultHandlerChain.java:107) [switchyard-runtime-0.3.0.CR1.jar:0.3.0.CR1]

          at org.switchyard.internal.LocalDispatcher.dispatch(LocalExchangeBus.java:72) [switchyard-runtime-0.3.0.CR1.jar:0.3.0.CR1]

          at org.switchyard.internal.ExchangeImpl.sendInternal(ExchangeImpl.java:253) [switchyard-runtime-0.3.0.CR1.jar:0.3.0.CR1]

          at org.switchyard.internal.ExchangeImpl.send(ExchangeImpl.java:176) [switchyard-runtime-0.3.0.CR1.jar:0.3.0.CR1]

          at org.switchyard.component.bean.ClientProxyBean$ClientProxyInvocationHandler.invoke(ClientProxyBean.java:317) [switchyard-component-bean-0.3.0.CR1.jar:0.3.0.CR1]

          at $Proxy34.sendData(Unknown Source)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]

          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]

          at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:48) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

          at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

          at org.jboss.weld.proxies.Source$1366014919$Proxy$_$$_WeldClientProxy.sendData(Source$1366014919$Proxy$_$$_WeldClientProxy.java) [weld-core-1.1.2.Final.jar:]

          at com.akuacom.tdm.module.ServiceHelper.sendSourceData(ServiceHelper.java:23) [routerTest-0.0.1-SNAPSHOT.jar:]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]

          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]

          at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:122) [jboss-as-weld-7.0.2.Final.jar:7.0.2.Final]

          at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:130) [jboss-as-weld-7.0.2.Final.jar:7.0.2.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:50) [jboss-as-ejb3-7.0.2.Final.jar:7.0.2.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor$CustomSessionInvocationContext.proceed(SessionInvocationContextInterceptor.java:126) [jboss-as-ejb3-7.0.2.Final.jar:7.0.2.Final]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:211) [jboss-as-ejb3-7.0.2.Final.jar:7.0.2.Final]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:284) [jboss-as-ejb3-7.0.2.Final.jar:7.0.2.Final]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:182) [jboss-as-ejb3-7.0.2.Final.jar:7.0.2.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:71) [jboss-as-ejb3-7.0.2.Final.jar:7.0.2.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:146)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]

          at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:76)

          at com.akuacom.tdm.module.ServiceHelperLocal$$$view2.sendSourceData(Unknown Source) [routerTest-0.0.1-SNAPSHOT.jar:]

          at com.akuacom.tdm.mbean.TelemetryDataModule.pingSource(TelemetryDataModule.java:40) [routerTest-0.0.1-SNAPSHOT.jar:]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]

          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]

          at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93) [:1.6.0_22]

          at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27) [:1.6.0_22]

          at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208) [:1.6.0_22]

          at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120) [:1.6.0_22]

          at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262) [:1.6.0_22]

          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) [:1.6.0_22]

          at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) [:1.6.0_22]

          at org.jboss.as.jmx.tcl.TcclMBeanServer.invoke(TcclMBeanServer.java:214)

          at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427) [:1.6.0_22]

          at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72) [:1.6.0_22]

          at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265) [:1.6.0_22]

          at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360) [:1.6.0_22]

          at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788) [:1.6.0_22]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]

          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]

          at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305) [:1.6.0_22]

          at sun.rmi.transport.Transport$1.run(Transport.java:159) [:1.6.0_22]

          at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_22]

          at sun.rmi.transport.Transport.serviceCall(Transport.java:155) [:1.6.0_22]

          at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535) [:1.6.0_22]

          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790) [:1.6.0_22]

          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649) [:1.6.0_22]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_22]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_22]

          at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]

      Caused by: java.lang.NoClassDefFoundError: org/w3c/dom/Node

          at org.apache.camel.component.jms.JmsBinding.getJMSMessageTypeForBody(JmsBinding.java:473) [camel-jms-2.8.0.jar:2.8.0]

          at org.apache.camel.component.jms.JmsBinding.createJmsMessage(JmsBinding.java:437) [camel-jms-2.8.0.jar:2.8.0]

          at org.apache.camel.component.jms.JmsBinding.makeJmsMessage(JmsBinding.java:267) [camel-jms-2.8.0.jar:2.8.0]

          at org.apache.camel.component.jms.JmsProducer$2.createMessage(JmsProducer.java:225) [camel-jms-2.8.0.jar:2.8.0]

          at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSendToDestination(JmsConfiguration.java:198) [camel-jms-2.8.0.jar:2.8.0]

          at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$100(JmsConfiguration.java:141) [camel-jms-2.8.0.jar:2.8.0]

          at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$3.doInJms(JmsConfiguration.java:175) [camel-jms-2.8.0.jar:2.8.0]

          at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:466)

          at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:172) [camel-jms-2.8.0.jar:2.8.0]

          at org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:347) [camel-jms-2.8.0.jar:2.8.0]

          at org.apache.camel.component.jms.JmsProducer.processInOnly(JmsProducer.java:303) [camel-jms-2.8.0.jar:2.8.0]

          at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:101) [camel-jms-2.8.0.jar:2.8.0]

          at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:114) [camel-core-2.8.0.jar:2.8.0]

          at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:286) [camel-core-2.8.0.jar:2.8.0]

          ... 125 more

      Caused by: java.lang.ClassNotFoundException: org.w3c.dom.Node from [Module "org.apache.camel.jms:main" from local module loader @7f2a3793 (roots: C:\bin\switchyard-as7-0.3\modules)]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)

          ... 140 more

       

      10:31:20,271 ERROR [org.switchyard.internal.DefaultHandlerChain] (RMI TCP Connection(2)-127.0.0.1) org.switchyard.HandlerException: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: From SourceBean:java.lang.String]

      10:31:20,272 WARN  [org.switchyard.internal.ExchangeImpl] (RMI TCP Connection(2)-127.0.0.1) Fault generated during exchange without a handler: org.switchyard.HandlerException: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: From SourceBean:java.lang.String]

       

      +++++++++++++++++++

       

      switchyard.xml:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <switchyard xmlns="urn:switchyard-config:switchyard:1.0" name="routerTest" targetNamespace="urn:com.example.switchyard:routerTest:0.0.1-SNAPSHOT">

          <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="routerTest" targetNamespace="urn:com.example.switchyard:routerTest:0.0.1-SNAPSHOT">

              <service name="SinkOne" promote="SinkOne">

                  <hornetq:binding.hornetq xmlns:hornetq="urn:switchyard-component-hornetq:config:1.0">

                      <hornetq:operationSelector operationName="processData"/>

                      <hornetq:config>

                          <hornetq:connector>

                              <hornetq:factoryClass>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</hornetq:factoryClass>

                          </hornetq:connector>

                          <hornetq:queue>jms.queue.GreetingServiceQueue</hornetq:queue>

                      </hornetq:config>

                  </hornetq:binding.hornetq>

              </service>

             

              <component name="RouterBean">

                  <implementation.camel xmlns="urn:switchyard-component-camel:config:1.0">

                      <java class="com.example.switchyard.routerTest.RouterBean"/>

                  </implementation.camel>

                  <service name="Router">

                      <interface.java interface="com.example.switchyard.routerTest.Router"/>

                  </service>

                  <reference name="SinkOne">

                      <interface.java interface="com.example.switchyard.routerTest.SinkOne"/>

                  </reference>

                  <reference name="SinkTwo">

                      <interface.java interface="com.example.switchyard.routerTest.SinkTwo"/>

                  </reference>

              </component>

              <component name="SinkOne">

                  <implementation.bean xmlns="urn:switchyard-component-bean:config:1.0" class="com.example.switchyard.routerTest.SinkOneBean"/>

                  <service name="SinkOne">

                      <interface.java interface="com.example.switchyard.routerTest.SinkOne"/>

                  </service>

              </component>

              <component name="SinkTwo">

                  <implementation.bean xmlns="urn:switchyard-component-bean:config:1.0" class="com.example.switchyard.routerTest.SinkTwoBean"/>

                  <service name="SinkTwo">

                      <interface.java interface="com.example.switchyard.routerTest.SinkTwo"/>

                  </service>

              </component>

              <component name="Source">

                  <implementation.bean xmlns="urn:switchyard-component-bean:config:1.0" class="com.example.switchyard.routerTest.SourceBean"/>

                  <service name="Source">

                      <interface.java interface="com.example.switchyard.routerTest.Source"/>

                  </service>

                  <reference name="Router">

                      <interface.java interface="com.example.switchyard.routerTest.Router"/>

                  </reference>

              </component>

          </composite>

      </switchyard>

        • 1. Re: Classloader problem with DLS route to jms queue
          beve

          Can you try adding a dependency to 'javax.api' module. For example, if you are generating your deployment with maven:

          <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                   <archive>
                      <manifestEntries>
                         <Dependencies>org.jboss.as.naming, javax.api</Dependencies>
                      </manifestEntries>
                   </archive>
                   </configuration>
           </plugin>
          
          

           

          Regards,

           

          /Daniel

          • 2. Re: Classloader problem with DLS route to jms queue
            kcbabo

            I would advise against routing to a jms: endpoint directly in the route definition.  You can use a switchyard: endpoint inside the route and then a reference binding in the application to map that reference to a jms queue.  This abstracts the binding details out of the routing logic.

            • 3. Re: Classloader problem with DLS route to jms queue
              atgnatus

              Daniel,

               

              I made the change and "mvn clean install" 'ed but the problem did not change.

              • 4. Re: Classloader problem with DLS route to jms queue
                atgnatus

                Keith,

                 

                I will try the reference instead. 

                 

                Our goal is to have a main service like EventService with a createEvent event operation.  That should create an event and return that event to the caller synchronously.  However, creating that event effects other system resources so we would like to call other services like updateForecast, notifiyClients, updateReportManager, etc. asynchronously.

                 

                So, after we know the event is created and can be returned to the caller, we want to kick off those secondary services without blocking the caller.

                 

                Since there are multiple secondary services, a DSL route seemed like the correct approach.  Since we wanted to call them asynchronously, a nonblocking message queue seemed like the best approach.

                 

                What is the correct switchyard way off doing that?

                 

                Thanks,

                Chris

                • 5. Re: Classloader problem with DLS route to jms queue
                  kcbabo

                  DSL route is the way to go for that type of service.  We will eventually support a local async delivery mode for oneway service invocations, but for now your best bet is to go with a JMS/HornetQ gateway binding to get similar behavior.   Using your example scenario, I would expect to see a route that looked something like this:

                   

                   

                  @Route(EventRoute.class)
                  public class EventRouteBuilder extends RouteBuilder {
                      
                      public void configure() {
                          from("switchyard://EventRoute")
                          .log("Received message for EventRoute : ${body}")
                                      .to("switchyard://EventService")
                                      .multicast()
                                         .to("switchyard://ForecastService")
                                         .to("switchyard://ClientService")
                                         .to("switchyard://ReportService");
                      }
                  }
                  

                   

                  Taking your earlier example, EventService could be a bean service implementation packaged with the application.  This service is invoked synchronously at the beginning of the route, followed by a multicast send to the other services.  The names used here are references, which means they are a named logical endpoint to a service.  These references should be bound to a HornetQ binding in your application.  That would look something like this:

                   

                  <switchyard xmlns="urn:switchyard-config:switchyard:1.0">
                      <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="eventApp" targetNamespace="urn:switchyard:application:eventApp">
                          <reference multiplicity="1..1" name="Forecast" promote="EventRouteBuilder/Forecast">
                              <binding.camel xmlns="urn:switchyard-component-camel:config:1.0" configURI="jms:GreetingServiceQueue?connectionFactory=#ConnectionFactory"/>
                          </reference>
                          <component name="EventRouteBuilder">
                              <implementation.camel xmlns="urn:switchyard-component-camel:config:1.0">
                                  <java class="org.example.eventApp.EventRouteBuilder"/>
                              </implementation.camel>
                              <service name="EventRoute">
                                  <interface.java interface="org.example.eventApp.EventRoute"/>
                              </service>
                              <reference name="Forecast">
                                  <interface.java interface="org.example.eventApp.Forecast"/>
                              </reference>
                          </component>
                      </composite>
                  </switchyard>
                  
                  

                   

                  I only included the binding for the Forecast reference in there, but hopefully it's enough to go on for the other references.

                  • 6. Re: Classloader problem with DLS route to jms queue
                    kcbabo

                    One other thing to note.  The config scanner for Camel routes does not generate configuration for references at this point.  This means that you have to add them to the switchyard.xml on your own right now.  Good news is that this can be added pretty easily.  Once that is in place, the only thing you need to do to generate the above configuration would be to:

                     

                    1) Create the Java DSL route

                    2) Run a forge command to add the reference binding:

                    camel-binding bind-reference --referenceName Forecast --configURI "jms:GreetingServiceQueue?connectionFactory=#ConnectionFactory"
                    

                    3) Build the project