Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 35605 invoked from network); 28 Feb 2011 11:31:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Feb 2011 11:31:02 -0000 Received: (qmail 5000 invoked by uid 500); 28 Feb 2011 11:31:02 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 4607 invoked by uid 500); 28 Feb 2011 11:30:59 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 4589 invoked by uid 99); 28 Feb 2011 11:30:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Feb 2011 11:30:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Feb 2011 11:30:57 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id E15EE41317 for ; Mon, 28 Feb 2011 11:30:36 +0000 (UTC) Date: Mon, 28 Feb 2011 11:30:36 +0000 (UTC) From: "Willem Jiang (JIRA)" To: dev@camel.apache.org Message-ID: <1937245404.1282.1298892636904.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <629069507.7712.1298362058447.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Commented: (CAMEL-3698) Failover loadbalancing between cxf endpoints results in IllegalStateException: Already connected MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000231#comment-13000231 ] Willem Jiang commented on CAMEL-3698: ------------------------------------- Hi Martijn, After spending some time to dig the code of CXF HttpConduit and Camel Tracer, I just found your rout has an issue of [StreamCache|http://camel.apache.org/stream-caching.html]. That explains why you set the log level to INFO the route work as expect. Because Camel Trace will log the Exchange when the log level set to INFO, and when it log the Exchange, it will try to turn the in message body into a StreamCache object. In this way we could reuse the stream in different endpoint. For your case, your route will send the exchange to another endpoint, so the message body should be cacheable. {code} java.lang.Throwable {code} Willem > Failover loadbalancing between cxf endpoints results in IllegalStateException: Already connected > ------------------------------------------------------------------------------------------------ > > Key: CAMEL-3698 > URL: https://issues.apache.org/jira/browse/CAMEL-3698 > Project: Camel > Issue Type: Bug > Components: camel-core, camel-cxf > Affects Versions: 2.6.0 > Reporter: Martijn van Ginkel > Assignee: Willem Jiang > > I have configured a route with a failover loadbalancer using camel 2.6.0 and cxf 2.3.2 as follows: > {code:xml} > > > > > > java.lang.Throwable > > > > > > {code} > We have configured two soap services at a local Tomcat, targetEnpoint1 and 2. If 'targetEndpoint1' is stopped (resulting in a 404), I expect the message to fail over to 'targetEndpoint2'. When I switch of the service at 'targetEndpoint1', executing the route results in a IllegalStateException: > {code} > 2011-02-21 16:45:24,430 [ERROR] Logger - Failed delivery for exchangeId: ID-MartijnvG-HP-19759-1298303117555-0-2. Exhausted after delivery attempt: 1 caught: java.lang.IllegalStateException: IllegalStateException invoking http://localhost:8080/echo2/echo: Already connected > java.lang.IllegalStateException: IllegalStateException invoking http://localhost:8080/echo2/echo: Already connected > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) > at java.lang.reflect.Constructor.newInstance(Unknown Source) > at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:2107) > at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2097) > at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) > at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:697) > at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) > at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:454) > at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:94) > at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) > at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104) > at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272) > at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98) > at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) > at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98) > at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89) > at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68) > at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) > at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98) > at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89) > at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99) > at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) > at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299) > at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208) > at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269) > at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) > at org.apache.camel.processor.loadbalancer.FailOverLoadBalancer.processExchange(FailOverLoadBalancer.java:226) > at org.apache.camel.processor.loadbalancer.FailOverLoadBalancer.access$300(FailOverLoadBalancer.java:38) > at org.apache.camel.processor.loadbalancer.FailOverLoadBalancer$FailOverAsyncCallback.done(FailOverLoadBalancer.java:286) > at org.apache.camel.processor.DefaultChannel$1.done(DefaultChannel.java:275) > at org.apache.camel.processor.RedeliveryErrorHandler.deliverToFailureProcessor(RedeliveryErrorHandler.java:639) > at org.apache.camel.processor.RedeliveryErrorHandler.processAsyncErrorHandler(RedeliveryErrorHandler.java:368) > at org.apache.camel.processor.RedeliveryErrorHandler$1.done(RedeliveryErrorHandler.java:317) > at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:78) > at org.apache.camel.component.cxf.CxfClientCallback.handleException(CxfClientCallback.java:85) > at org.apache.cxf.interceptor.ClientOutFaultObserver.onMessage(ClientOutFaultObserver.java:59) > at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:2203) > at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$2.run(AutomaticWorkQueueImpl.java:253) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) > at java.lang.Thread.run(Unknown Source) > Caused by: java.lang.IllegalStateException: Already connected > at java.net.HttpURLConnection.setFixedLengthStreamingMode(Unknown Source) > at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.thresholdNotReached(HTTPConduit.java:1937) > at org.apache.cxf.io.AbstractThresholdOutputStream.close(AbstractThresholdOutputStream.java:99) > at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2029) > ... 38 more > {code} > The failover does not work. However when I change the loglevel of _org.apache.camel.processor.interceptor.Tracer_ from WARN to INFO in my log4j.properties, the failover does work as expected. In both cases tracing is enabled. > I believe this is a bug since the behaviour of the failover changes if the log level is changed. > We were able to reproduce this behaviour on multiple systems. If you have any problems reproducing this behaviour we are happy to provide more information or an example project. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira