I just checked the code and found an interesting thing. public class DefaultSpringErrorHandler implements ErrorHandler {
private final LoggingExceptionHandler handler; private final boolean logStackTrace; public DefaultSpringErrorHandler(Class<?> owner, LoggingLevel level, boolean logStackTrace) { this.handler = new LoggingExceptionHandler(owner, level); this.logStackTrace = logStackTrace; } @Override public void handleError(Throwable throwable) { if (logStackTrace) { handler.handleException("Execution of JMS message listener failed", throwable); } else { handler.handleException("Execution of JMS message listener failed. Caused by: [" + throwable.getMessage() + "]", null); } } } I double you set the jms configure option errorHandlerLogStackTrace to be false. You can get the full stack trace if you set the option to true. -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com(http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com(http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On February 11, 2014 at 4:17:21 PM, Rural Hunter (ruralhun...@gmail.com) wrote: > > Sorry for late response. I was in vacation. I ran your test and > checked > the stack trace output and found some difference with the one > I got > problem. > > Stacktrace with your test: > org.apache.camel.CamelExecutionException: Exception occurred > during > execution on the exchange: Exchange[Message: Hello World] > at > org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1368) > > at > org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:283) > at > org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:66) > > at > org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398) > > at > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) > > at org.apache.camel.processor.Pipeline.process(Pipeline.java:118) > at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) > at > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) > > at > org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:291) > > at > org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:200) > at > org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:147) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > > at java.lang.Thread.run(Thread.java:744) > Caused by: java.lang.NoClassDefFoundError > at org.apache.camel.util.ProcessorFail.process(ProcessorFail.java:26) > at > org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63) > > ... 11 more > > It indicates the exception is thrown in DelegateSyncProcessor. > But in > the error log of my problem, I found it's in DelegateAsyncProcessor. > I > don't know in which case Camel uses DelegateSyncProcessor and > DelegateAsyncProcessor. Could that cause the different behavior? > > 2014-01-23 18:06:04 WARN Camel (camel-1) thread #0 - > JmsConsumer[com.test.new] > org.apache.camel.component.jms.EndpointMessageListener > - Execution of > JMS message listener failed. Caused by > : [org.apache.camel.CamelExecutionException - Exception > occurred during > execution on the exchange: Exchange[JmsMessage[JmsMessageID: > ID:test-ubt-43737-1390470192665-1:1:5:1:1]]] > org.apache.camel.CamelExecutionException: Exception occurred > during > execution on the exchange: Exchange[JmsMessage[JmsMessageID: > ID:test-ubt-43737-1390470192665-1:1:5:1:1]] > at > org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1368)[camel-core-2.12.2.jar:2.12.2] > > at > org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:283)[camel-core-2.12.2.jar:2.12.2] > > at > org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:66)[camel-core-2.12.2.jar:2.12.2] > > at > org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[camel-core-2.12.2.jar:2.12.2] > > at > org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[camel-core-2.12.2.jar:2.12.2] > > at > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[camel-core-2.12.2.jar:2.12.2] > > at > org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[camel-core-2.12.2.jar:2.12.2] > > at > org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[camel-core-2.12.2.jar:2.12.2] > > at > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[camel-core-2.12.2.jar:2.12.2] > > at > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)[camel-core-2.12.2.jar:2.12.2] > > at > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)[camel-core-2.12.2.jar:2.12.2] > > at > org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:103)[camel-jms-2.12.2.jar:2.12.2] > > at > org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE] > > at > org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE] > > at > org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE] > > at > org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE] > > at > org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE] > > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1103)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEA > > SE] > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1095)[spring-jms-3.2.4.RELEASE.jar:3.2.4.R > > ELEASE] > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:992)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE] > > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_25] > > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_25] > > at java.lang.Thread.run(Thread.java:724)[:1.7.0_25] > > 于 2014/1/29 17:01, Claus Ibsen 写道: > > Did some unit tests which cannot reproduce the issue you see. > > https://github.com/apache/camel/commit/8cd86620d09f9641f4d29c5a131f162fd48ec547 > > > >