1 Reply Latest reply on Aug 12, 2013 1:28 AM by Freeman(Yue) Fang

    Error invoking webservice - Already connected

    Anirban Gupta Newbie

      Hi,

       

      I have a backend webservice up and running, and exposed a proxy webservice using Camel that accepts requests through consumer, does some processing and calls the backend service through producer, but I am getting an error while connecting to the backend service :

       

      12:51:37,448 | WARN  | qtp1944116-338   | PhaseInterceptorChain            | 147 - org.apache.cxf.cxf-api - 2.6.0.redhat-60024 | Application {http://helloproducer.java.com/}HelloWorldService has thrown exception, unwinding now

      org.apache.cxf.interceptor.Fault: IllegalStateException invoking http://localhost:9001/HelloWorld/: Already connected

                at org.apache.camel.component.cxf.CxfConsumer$1.checkFailure(CxfConsumer.java:208)

                at org.apache.camel.component.cxf.CxfConsumer$1.setResponseBack(CxfConsumer.java:186)

                at org.apache.camel.component.cxf.CxfConsumer$1.asyncInvoke(CxfConsumer.java:108)

                at org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:72)

                at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024]

                at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024]

                at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024]

                at org.apache.cxf.phase.PhaseInterceptorChain.resume(PhaseInterceptorChain.java:231)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024]

                at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024]

                at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)[172:org.apache.cxf.cxf-rt-transports-http-jetty:2.6.0.redhat-60024]

                at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)[172:org.apache.cxf.cxf-rt-transports-http-jetty:2.6.0.redhat-60024]

                at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)[172:org.apache.cxf.cxf-rt-transports-http-jetty:2.6.0.redhat-60024]

                at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1040)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:976)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:193)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.server.Server.handleAsync(Server.java:403)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:488)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)[79:org.eclipse.jetty.http:7.6.7.v20120910]

                at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)[79:org.eclipse.jetty.http:7.6.7.v20120910]

                at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627)[81:org.eclipse.jetty.io:7.6.7.v20120910]

                at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51)[81:org.eclipse.jetty.io:7.6.7.v20120910]

                at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[90:org.eclipse.jetty.util:7.6.7.v20120910]

                at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[90:org.eclipse.jetty.util:7.6.7.v20120910]

                at java.lang.Thread.run(Unknown Source)[:1.7.0_03]

      Caused by: java.lang.IllegalStateException: IllegalStateException invoking http://localhost:9001/HelloWorld/: Already connected

                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.7.0_03]

                at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)[:1.7.0_03]

                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)[:1.7.0_03]

                at java.lang.reflect.Constructor.newInstance(Unknown Source)[:1.7.0_03]

                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1467)

                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1457)

                at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)

                at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:660)

                at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)

                at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024]

                at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)

                at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:456)

                at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:112)

                at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)

                at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)

                at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)

                at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)

                at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)

                at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                at org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:81)

                at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)

                at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)

                at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)

                at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)

                at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)

                at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)

                at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)

                at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)

                at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)

                at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)

                at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)

                at org.apache.camel.component.cxf.CxfConsumer$1.asyncInvoke(CxfConsumer.java:93)

                at org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:72)

                at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)

                at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)[:1.7.0_03]

                at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)[:1.7.0_03]

                at java.util.concurrent.FutureTask.run(Unknown Source)[:1.7.0_03]

                at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024]

                at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:107)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024]

                at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024]

                at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024]

                at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)[172:org.apache.cxf.cxf-rt-transports-http-jetty:2.6.0.redhat-60024]

                at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)[172:org.apache.cxf.cxf-rt-transports-http-jetty:2.6.0.redhat-60024]

                at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)[172:org.apache.cxf.cxf-rt-transports-http-jetty:2.6.0.redhat-60024]

                at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1040)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:976)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.server.Server.handle(Server.java:363)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)[84:org.eclipse.jetty.server:7.6.7.v20120910]

                ... 10 more

      Caused by: java.lang.IllegalStateException: Already connected

                at java.net.HttpURLConnection.setFixedLengthStreamingMode(Unknown Source)[:1.7.0_03]

                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.thresholdNotReached(HTTPConduit.java:1333)

                at org.apache.cxf.io.AbstractThresholdOutputStream.close(AbstractThresholdOutputStream.java:99)

                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1430)

                ... 75 more

       

      Please help.