Hi It seems the stacktrace is from the EndpointMessageListener which is used for consuming messages on JMS message queues. The exception is thrown by spring-jms (which is used for consuming JMS messages). And thus the exception cannot be handled by Camel in traditional way (using errorHandler, onException etc.). See chapter 4 in the Camel book for more details.
Essentially the exception happens *before* Camel receives the messages from the underlying component API/framework (which in this case is spring-jms). So to handle those kind of exceptions/errors it becomes component specific, whether they allow end users to deal with those exceptions. The JMS component has an exceptionListener option you can configure and have spring-jms invoke with the caused exception. On Tue, Jul 12, 2011 at 11:31 AM, kellny <[email protected]> wrote: > This is stack trace.I can't catch > *org.springframework.jms.InvalidDestinationException* in my root. > > 2011-07-12 07:26:59,264 [Camel (camelContext) thread #0 - > JmsConsumer[trs-reception-0]] DEBUG [JmsConfiguration$CamelJmsTemplate] > Executing callback on JMS Session: > com.tibco.tibjms.TibjmsxSessionImp@13c33b7 > 2011-07-12 07:26:59,264 [Camel (camelContext) thread #0 - > JmsConsumer[trs-reception-0]] DEBUG [EndpointMessageListener] Caused by: > [org.apache.camel.RuntimeCamelException - > org.springframework.jms.InvalidDestinationException: Invalid temporary > destination; nested exception is javax.jms.InvalidDestinationException: > Invalid temporary destination] > org.apache.camel.RuntimeCamelException: > org.springframework.jms.InvalidDestinationException: Invalid temporary > destination; nested exception is javax.jms.InvalidDestinationException: > Invalid temporary destination > at > org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139) > at > org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:143) > at > org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560) > at > org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498) > at > org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467) > at > org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325) > at > org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:243) > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058) > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050) > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Unable-to-catch-exception-from-Camel-tp4578302p4578310.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
