camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cgiera <christoph.gi...@mic-cust.com>
Subject Re: ClassCastException using cxf:bean
Date Thu, 19 Apr 2012 13:30:34 GMT

cgiera wrote
> 
> Hello,
> 
> one of our customers has serious problems with our software which uses
> camel 2.6.0. 
> Our cxf-Route throws a ClassCastException
> 
> The route looks like this:
> 
> 		from("cxf:bean:endpoint")
> 				.transacted("PROPAGATION_REQUIRED")
> 				.beanRef(Bean1.class.getName(), method1)
> 				.beanRef(Bean2.class.getName())
> 				.split().method(Bean3.class.getName())
> 					.setExchangePattern(ExchangePattern.InOnly)
> 					.to("jmsAq:queue:QueueName?transacted=true")
> 				.end()
> 				.beanRef(Bean1.class.getName(), method2)
> 				.beanRef(Bean4.class.getName());
>  
> The trace of the exception looks like this:
> 
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 2012-03-07 16:12:15,056
> [http-8443-10] TRACE  - Chosen method to invoke: public java.lang.Object
> Bean1.process(org.apache.camel.Exchange) throws java.lang.Exception on
> bean: class Bean2
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 2012-03-07 16:12:15,057
> [http-8443-12] TRACE  - Chosen method to invoke: public java.lang.Object
> Bean1.process(org.apache.camel.Exchange) throws java.lang.Exception on
> bean: Bean2@6bda710a
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 2012-03-07 16:12:15,057
> [http-8443-10] TRACE  - >>>> invoking: public java.lang.Object
> Bean1.process(org.apache.camel.Exchange) throws java.lang.Exception on
> bean: class Bean2 with arguments: {Exchange[Message: [Message@116802e3]]}
> for exchange: Exchange[Message: [Message@116802e3]]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 2012-03-07 16:12:15,057
> [http-8443-12] TRACE  - >>>> invoking: public java.lang.Object
> Bean1.process(org.apache.camel.Exchange) throws java.lang.Exception on
> bean: Bean2@6bda710a with arguments: {Exchange[Message:
> [Message@116802e3]]} for exchange: Exchange[Message: [Message@116802e3]]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 2012-03-07 16:12:15,058
> [http-8443-10] ERROR  - Failed delivery for exchangeId:
> ID-nlzehvdcs1sx898-43015-1325240144169-0-3304451. Exhausted after delivery
> attempt: 1 caught: java.lang.IllegalArgumentException:
> java.lang.ClassCastException@52337ed7
> INFO   | jvm 1    | 2012/03/07 16:12:15 |
> java.lang.IllegalArgumentException: java.lang.ClassCastException@52337ed7
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> sun.reflect.GeneratedMethodAccessor243.invoke(Unknown Source)
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_26]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_26]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:322)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:224)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:167)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:62)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:62)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:62)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:125)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:62)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.spring.spi.TransactionErrorHandler.processByErrorHandler(TransactionErrorHandler.java:211)[camel-spring-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.spring.spi.TransactionErrorHandler$1.doInTransactionWithoutResult(TransactionErrorHandler.java:171)[camel-spring-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)[org.springframework.transaction-3.0.5.RELEASE.jar:3.0.5.RELEASE]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)[org.springframework.transaction-3.0.5.RELEASE.jar:3.0.5.RELEASE]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:164)[camel-spring-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:121)[camel-spring-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:92)[camel-spring-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:101)[camel-spring-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:125)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)[camel-core-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.component.cxf.CxfConsumer$1.syncInvoke(CxfConsumer.java:136)[camel-cxf-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:78)[camel-cxf-2.6.0.jar:2.6.0]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)[cxf-2.2.11.jar:2.2.11]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_26]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_26]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_26]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)[cxf-2.2.11.jar:2.2.11]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)[cxf-2.2.11.jar:2.2.11]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)[cxf-2.2.11.jar:2.2.11]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:111)[cxf-2.2.11.jar:2.2.11]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:99)[cxf-2.2.11.jar:2.2.11]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:428)[cxf-2.2.11.jar:2.2.11]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:183)[cxf-2.2.11.jar:2.2.11]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:148)[cxf-2.2.11.jar:2.2.11]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)[cxf-2.2.11.jar:2.2.11]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)[cxf-2.2.11.jar:2.2.11]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:637)[servlet-api.jar:]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)[cxf-2.2.11.jar:2.2.11]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)[catalina.jar:6.0.32]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)[catalina.jar:6.0.32]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)[catalina.jar:6.0.32]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)[catalina.jar:6.0.32]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)[catalina.jar:6.0.32]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)[catalina.jar:6.0.32]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)[catalina.jar:6.0.32]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)[catalina.jar:6.0.32]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)[catalina.jar:6.0.32]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)[tomcat-coyote.jar:6.0.32]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)[tomcat-coyote.jar:6.0.32]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)[tomcat-coyote.jar:6.0.32]
> INFO   | jvm 1    | 2012/03/07 16:12:15 | 	at
> java.lang.Thread.run(Thread.java:662)[:1.6.0_26]
> 
> It is interesting to see that two threads executing the same method(s) at
> the nearly same time. One thread uses an instance of the bean and the
> other thread uses the class(which I think leads to the
> ClassCastException).
> 
> I've looked for some more information in the camel-users forum and I've
> found the following:
> http://camel.465427.n5.nabble.com/Bean-component-BeanInfo-thread-safety-td3387197.html
> 
> Because of this information I've added the method-Parameter to the
> beanRef-method of the cxf-route(not to all routes).
> 
> Sadly I've to say that this solution haven't changed anything, the
> ClassCastException is still thrown when executing Bean1, Bean2, Bean3 or
> Bean4.
> 
> Could someone please help me?
> 
> Thanks in advance.
> 
> 
> kind regards,
> Christoph
> 

Post for mailinglist

--
View this message in context: http://camel.465427.n5.nabble.com/ClassCastException-using-cxf-bean-tp5599810p5651762.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message