You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Martijn van Ginkel (JIRA)" <ji...@apache.org> on 2011/02/22 09:07:38 UTC
[jira] Created: (CAMEL-3698) Failover loadbalancing between cxf
endpoints results in IllegalStateException: Already connected
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
I have configured a route with a failover loadbalancer using camel 2.6.0 and cxf 2.3.2 as follows:
{code:xml}
<camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true">
<route>
<from uri="cxf:bean:entryEndpoint" />
<loadBalance>
<failover>
<exception>java.lang.Throwable</exception>
</failover>
<to uri="cxf:bean:targetEndpoint1" />
<to uri="cxf:bean:targetEndpoint2" />
</loadBalance>
</route>
</camelContext>{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
[jira] Commented: (CAMEL-3698) Failover loadbalancing between cxf
endpoints results in IllegalStateException: Already connected
Posted by "Martijn van Ginkel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000760#comment-13000760 ]
Martijn van Ginkel commented on CAMEL-3698:
-------------------------------------------
Thanks, your solution makes sense and works perfectly. Why is stream caching not automatically activated for routes containing a failover loadbalancer? It seems to me that without stream-caching, the failover can not work at all.
> 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}
> <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true">
> <route>
> <from uri="cxf:bean:entryEndpoint" />
> <loadBalance>
> <failover>
> <exception>java.lang.Throwable</exception>
> </failover>
> <to uri="cxf:bean:targetEndpoint1" />
> <to uri="cxf:bean:targetEndpoint2" />
> </loadBalance>
> </route>
> </camelContext>{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
[jira] Commented: (CAMEL-3698) Failover loadbalancing between cxf
endpoints results in IllegalStateException: Already connected
Posted by "Martijn van Ginkel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998271#comment-12998271 ]
Martijn van Ginkel commented on CAMEL-3698:
-------------------------------------------
Using ?synchronous=true does not make a difference, results in the same error:
{noformat} IllegalStateException invoking http://localhost:8080/echo2/echo?synchronous=true: Already connected{noformat}
I run camel by using camel-maven-plugin version 2.6.0.
The services run on Tomcat 6.0.20 on windows xp.
The JDK version is 1.6.0_14.
> 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
>
> I have configured a route with a failover loadbalancer using camel 2.6.0 and cxf 2.3.2 as follows:
> {code:xml}
> <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true">
> <route>
> <from uri="cxf:bean:entryEndpoint" />
> <loadBalance>
> <failover>
> <exception>java.lang.Throwable</exception>
> </failover>
> <to uri="cxf:bean:targetEndpoint1" />
> <to uri="cxf:bean:targetEndpoint2" />
> </loadBalance>
> </route>
> </camelContext>{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
[jira] Resolved: (CAMEL-3698) Failover loadbalancing between cxf
endpoints results in IllegalStateException: Already connected
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-3698.
--------------------------------
Resolution: Not A Problem
Fix Version/s: 2.7.0
I have added a note on the load balancer wiki page about that you should enable stream caching if using streams.
> 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
> Fix For: 2.7.0
>
>
> I have configured a route with a failover loadbalancer using camel 2.6.0 and cxf 2.3.2 as follows:
> {code:xml}
> <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true">
> <route>
> <from uri="cxf:bean:entryEndpoint" />
> <loadBalance>
> <failover>
> <exception>java.lang.Throwable</exception>
> </failover>
> <to uri="cxf:bean:targetEndpoint1" />
> <to uri="cxf:bean:targetEndpoint2" />
> </loadBalance>
> </route>
> </camelContext>{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
[jira] Commented: (CAMEL-3698) Failover loadbalancing between cxf
endpoints results in IllegalStateException: Already connected
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ 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}
<camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true">
<route streamCache="true">
<from uri="cxf:bean:entryEndpoint" />
<loadBalance>
<failover>
<exception>java.lang.Throwable</exception>
</failover>
<to uri="cxf:bean:targetEndpoint1" />
<to uri="cxf:bean:targetEndpoint2" />
</loadBalance>
</route>
</camelContext>
{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}
> <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true">
> <route>
> <from uri="cxf:bean:entryEndpoint" />
> <loadBalance>
> <failover>
> <exception>java.lang.Throwable</exception>
> </failover>
> <to uri="cxf:bean:targetEndpoint1" />
> <to uri="cxf:bean:targetEndpoint2" />
> </loadBalance>
> </route>
> </camelContext>{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
[jira] Commented: (CAMEL-3698) Failover loadbalancing between cxf
endpoints results in IllegalStateException: Already connected
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998207#comment-12998207 ]
Claus Ibsen commented on CAMEL-3698:
------------------------------------
Can you try using ?synchronous=true on the CXF endpoints to see if it makes a difference?
What version of Tomcat and JDK are you using?
> 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
>
> I have configured a route with a failover loadbalancer using camel 2.6.0 and cxf 2.3.2 as follows:
> {code:xml}
> <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true">
> <route>
> <from uri="cxf:bean:entryEndpoint" />
> <loadBalance>
> <failover>
> <exception>java.lang.Throwable</exception>
> </failover>
> <to uri="cxf:bean:targetEndpoint1" />
> <to uri="cxf:bean:targetEndpoint2" />
> </loadBalance>
> </route>
> </camelContext>{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
[jira] Commented: (CAMEL-3698) Failover loadbalancing between cxf
endpoints results in IllegalStateException: Already connected
Posted by "Martijn van Ginkel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998382#comment-12998382 ]
Martijn van Ginkel commented on CAMEL-3698:
-------------------------------------------
Sure, this is the configuration of entryEndpoint and targetEndpoint1:
{code:xml}
<cxf:cxfEndpoint
id="entryEndpoint"
serviceName="echo:EchoService"
endpointName="echo:EchoServiceImplPort"
xmlns:echo="http://www.telecats.nl/nl.telecats.foundation.echo-service"
address="http://localhost:8081/echo-server/echo"
wsdlURL="http://localhost:8080/echo1/echo?wsdl">
<cxf:properties>
<beans:entry key="dataFormat" value="MESSAGE"/>
<beans:entry key="synchronous" value="true"/>
</cxf:properties>
</cxf:cxfEndpoint>
<cxf:cxfEndpoint
id="targetEndpoint1"
serviceName="echo:EchoService"
endpointName="echo:EchoServiceImplPort"
xmlns:echo="http://www.telecats.nl/nl.telecats.foundation.echo-service"
address="http://localhost:8080/echo1/echo"
wsdlURL="http://localhost:8080/echo1/echo?wsdl">
<cxf:properties>
<beans:entry key="dataFormat" value="MESSAGE"/>
<beans:entry key="synchronous" value="true"/>
</cxf:properties>
</cxf:cxfEndpoint>{code}
> 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}
> <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true">
> <route>
> <from uri="cxf:bean:entryEndpoint" />
> <loadBalance>
> <failover>
> <exception>java.lang.Throwable</exception>
> </failover>
> <to uri="cxf:bean:targetEndpoint1" />
> <to uri="cxf:bean:targetEndpoint2" />
> </loadBalance>
> </route>
> </camelContext>{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
[jira] Assigned: (CAMEL-3698) Failover loadbalancing between cxf
endpoints results in IllegalStateException: Already connected
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Willem Jiang reassigned CAMEL-3698:
-----------------------------------
Assignee: Willem Jiang
> 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}
> <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true">
> <route>
> <from uri="cxf:bean:entryEndpoint" />
> <loadBalance>
> <failover>
> <exception>java.lang.Throwable</exception>
> </failover>
> <to uri="cxf:bean:targetEndpoint1" />
> <to uri="cxf:bean:targetEndpoint2" />
> </loadBalance>
> </route>
> </camelContext>{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
[jira] Commented: (CAMEL-3698) Failover loadbalancing between cxf
endpoints results in IllegalStateException: Already connected
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000773#comment-13000773 ]
Claus Ibsen commented on CAMEL-3698:
------------------------------------
If you use streams you have to enable the stream cache if needed, such as when using error handling with redelivery, or failover.
> 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}
> <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true">
> <route>
> <from uri="cxf:bean:entryEndpoint" />
> <loadBalance>
> <failover>
> <exception>java.lang.Throwable</exception>
> </failover>
> <to uri="cxf:bean:targetEndpoint1" />
> <to uri="cxf:bean:targetEndpoint2" />
> </loadBalance>
> </route>
> </camelContext>{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
[jira] Commented: (CAMEL-3698) Failover loadbalancing between cxf
endpoints results in IllegalStateException: Already connected
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998372#comment-12998372 ]
Willem Jiang commented on CAMEL-3698:
-------------------------------------
Hi Martijn
Can you also past the configuration of cxf:bean:targetEndpoint1 and cxf:bean:entryEndpoint?
It will be helpful for us the trace the issue.
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
>
> I have configured a route with a failover loadbalancer using camel 2.6.0 and cxf 2.3.2 as follows:
> {code:xml}
> <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true">
> <route>
> <from uri="cxf:bean:entryEndpoint" />
> <loadBalance>
> <failover>
> <exception>java.lang.Throwable</exception>
> </failover>
> <to uri="cxf:bean:targetEndpoint1" />
> <to uri="cxf:bean:targetEndpoint2" />
> </loadBalance>
> </route>
> </camelContext>{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