camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: CxfRsProducer is not thread safe
Date Fri, 03 Aug 2012 07:41:12 GMT
On 03/08/12 10:26, Sergey Beryozkin wrote:
> Hi
> On 02/08/12 23:42, dumi_p wrote:
>> Hi,
>>
>> In the mean time, I tried to use jaxrs:client, but got into another
>> problem. Seems like<jaxrs:client> accepts only interfaces for the
>> serviceClass attribute, so I created a new interface
>
> it can create proxies from concrete classes, but it needs a cglib-nodep
> for it to work.
>
>> (CustomerServiceInterface) and configured it as it follows:
>> <jaxrs:client id="rsClient"
>> address="http://localhost:8080/camel-example-cxf-tomcat/webservices/rest"
>> serviceClass="org.apache.camel.example.cxf.restobjects.CustomerServiceInterface"
>>
>> inheritHeaders="true">
>> <jaxrs:headers>
>> <entry key="Accept" value="text/xml" />
>> </jaxrs:headers>
>> </jaxrs:client>
>>
>
> add a 'threadSafe' flag please
>
>> Route is:
>> from("cxfrs:bean:rsServer")
>> .to("log:input")
>> .to("bean:rsClient")
>> .to("log:output");
>>
>> Error I get is:
>
> I think the exception below suggests a camel bean component can not
> invoke on proxies.
>

Actually, it seems more to do with the misconfiguration, according to
http://camel.apache.org/bean.html

one needs to specify a 'method' parameter

Try it please
Sergey

> Cheers, Sergey
>
> P.S. Btw, if you can get a chance, please try a test code I attached to
> JIRA. I do not dispute the fact you saw the thread-safety related
> exception but I need to create a failing test to start with :-) and the
> test I did mimics the way your route works very closely
>
>> 2012-08-02 23:31:20,894 [http-8080-1 ] ERROR DefaultErrorHandler
>> - Failed delivery for (MessageId: ID-Dumi-PC-57364-1343939398047-0-1 on
>> ExchangeId: ID-Dumi-PC-57364-1343939398047-0-2). Exhausted after delivery
>> attempt: 1 caught:
>> org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous
>> method invocations possible: [public final
>> org.apache.camel.example.cxf.restobjects.Customer
>> $Proxy49.getCustomer(java.lang.String), public final
>> org.apache.camel.example.cxf.restobjects.Customer
>> $Proxy49.getCustomer(java.lang.String)]. Exchange[Message: 123]
>> org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous
>> method invocations possible: [public final
>> org.apache.camel.example.cxf.restobjects.Customer
>> $Proxy49.getCustomer(java.lang.String), public final
>> org.apache.camel.example.cxf.restobjects.Customer
>> $Proxy49.getCustomer(java.lang.String)]. Exchange[Message: 123]
>> at
>> org.apache.camel.component.bean.BeanInfo.chooseBestPossibleMethodInfo(BeanInfo.java:587)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.component.bean.BeanInfo.chooseMethodWithMatchingBody(BeanInfo.java:544)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.component.bean.BeanInfo.chooseMethod(BeanInfo.java:496)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:225)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:162)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:149)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:73)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:101)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:120)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:292)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:115)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:330)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.Pipeline.process(Pipeline.java:117)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)[camel-core-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.component.cxf.jaxrs.CxfRsInvoker.syncInvoke(CxfRsInvoker.java:122)[camel-cxf-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.camel.component.cxf.jaxrs.CxfRsInvoker.performInvocation(CxfRsInvoker.java:60)[camel-cxf-2.10.0.jar:2.10.0]
>>
>> at
>> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)[cxf-api-2.6.1.jar:2.6.1]
>>
>> at
>> org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167)[cxf-rt-frontend-jaxrs-2.6.1.jar:2.6.1]
>>
>> at
>> org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94)[cxf-rt-frontend-jaxrs-2.6.1.jar:2.6.1]
>>
>> at
>> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)[cxf-api-2.6.1.jar:2.6.1]
>>
>> at
>> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)[cxf-api-2.6.1.jar:2.6.1]
>>
>> at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)[cxf-api-2.6.1.jar:2.6.1]
>>
>> at
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122)[cxf-api-2.6.1.jar:2.6.1]
>>
>> at
>> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211)[cxf-rt-transports-http-2.6.1.jar:2.6.1]
>>
>> at
>> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)[cxf-rt-transports-http-2.6.1.jar:2.6.1]
>>
>> at
>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)[cxf-rt-transports-http-2.6.1.jar:2.6.1]
>>
>> at
>> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)[cxf-rt-transports-http-2.6.1.jar:2.6.1]
>>
>> at
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187)[cxf-rt-transports-http-2.6.1.jar:2.6.1]
>>
>> at
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115)[cxf-rt-transports-http-2.6.1.jar:2.6.1]
>>
>> at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:617)[servlet-api-6.0.29.jar:]
>>
>> at
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166)[cxf-rt-transports-http-2.6.1.jar:2.6.1]
>>
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)[catalina-6.0.29.jar:6.0.29]
>>
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)[catalina-6.0.29.jar:6.0.29]
>>
>> at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)[catalina-6.0.29.jar:6.0.29]
>>
>> at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)[catalina-6.0.29.jar:6.0.29]
>>
>> at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)[catalina-6.0.29.jar:6.0.29]
>>
>> at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)[catalina-6.0.29.jar:6.0.29]
>>
>> at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)[catalina-6.0.29.jar:6.0.29]
>>
>> at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)[catalina-6.0.29.jar:6.0.29]
>>
>> at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)[coyote-6.0.29.jar:6.0.29]
>>
>> at
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)[coyote-6.0.29.jar:6.0.29]
>>
>> at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)[coyote-6.0.29.jar:6.0.29]
>>
>>
>> Attached relevant files.
>>
>> Any help appreciated.
>>
>> Regards,
>> /Dumitru
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/CxfRsProducer-is-not-thread-safe-tp5716351p5716712.html
>>
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
View raw message