9 Replies Latest reply on Oct 7, 2009 8:25 AM by Richard Opalka

    Keep alive doesn't doesn't work for closed TCP/IP connection

    Richard Opalka Master

      My usecase:

      I'm using JBossWS Netty client (via JAX-WS proxy API) with keep-alive feature enabled (this is the default).
      When remote http server goes down and up again all lately used cached connections on client side will fail with the following exception:

      java.io.IOException: Could not transmit message">javax.xml.ws.WebServiceException: java.io.IOException: Could not transmit message
       at org.jboss.ws.core.jaxws.client.ClientImpl.handleRemoteException(ClientImpl.java:392)
       at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:302)
       at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:170)
       at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
       at $Proxy13.echo(Unknown Source)
       at org.jboss.test.ws.jaxws.endpoint.jse.UsecasesTestCase.invokeEndpoint1(UsecasesTestCase.java:128)
       at org.jboss.test.ws.jaxws.endpoint.jse.UsecasesTestCase.testTwoPortsAndLongPaths(UsecasesTestCase.java:86)
      Caused by: java.io.IOException: Could not transmit message
       at org.jboss.ws.core.client.transport.NettyClient.invoke(NettyClient.java:194)
       at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:150)
       at org.jboss.ws.core.client.SOAPProtocolConnectionHTTP.invoke(SOAPProtocolConnectionHTTP.java:69)
       at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:344)
       at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:290)
       ... 31 more
      Caused by: java.util.concurrent.ExecutionException: java.nio.channels.ClosedChannelException
       at org.jboss.ws.core.client.transport.WSResponseHandler$FutureResult.get(WSResponseHandler.java:178)
       at org.jboss.ws.core.client.transport.WSResponseHandler$FutureResult.get(WSResponseHandler.java:113)
       at org.jboss.ws.core.client.transport.NettyClient.invoke(NettyClient.java:156)
       ... 35 more
      Caused by: java.nio.channels.ClosedChannelException
       at org.jboss.netty.channel.socket.nio.NioWorker.cleanUpWriteBuffer(NioWorker.java:624)
       at org.jboss.netty.channel.socket.nio.NioWorker.write(NioWorker.java:353)
       at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:124)
       at org.jboss.netty.channel.Channels.write(Channels.java:889)
       at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:76)
       at org.jboss.netty.channel.Channels.write(Channels.java:869)
       at org.jboss.netty.channel.Channels.write(Channels.java:818)
       at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:236)
       at org.jboss.ws.core.client.transport.NettyTransportOutputStream.close(NettyTransportOutputStream.java:142)
       at org.jboss.ws.core.client.transport.NettyClient.writeRequest(NettyClient.java:240)
       at org.jboss.ws.core.client.transport.NettyClient.invoke(NettyClient.java:147)
       ... 35 more
      


      Our client side Netty connections cache have to implement algorithm that will detect, if cached connection is still alive (the one going to be returned to client).