2 Replies Latest reply on Apr 8, 2011 4:36 AM by jaikiran pai

    Web Service invocation hang issue

    Alexander Nemsadze Newbie

      We have following issue in production with JBoss 5.1, JBossWS.

      Web Service invocation hangs and never times out (besides configured default 5 minutes).

      Here is thread dump of such thread:

       

      Thread: http-0.0.0.0-80-1 : priority:5, demon:true, threadId:158, threadState:RUNNABLE

      java.net.SocketInputStream.socketRead0(Native Method)
      java.net.SocketInputStream.read(SocketInputStream.java:129)
      java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
      java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
      java.io.BufferedInputStream.read(BufferedInputStream.java:317)
      - locked <0x14dffe> (a java.io.BufferedInputStream)
      sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687)
      sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
      sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1200)
      - locked <0xbc5c0d> (a sun.net.www.protocol.http.HttpURLConnection)
      java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
      org.jboss.remoting.transport.http.HTTPClientInvoker.getResponseCode(HTTPClientInvoker.java:1238)
      org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:339)
      org.jboss.remoting.transport.http.HTTPClientInvoker.makeInvocation(HTTPClientInvoker.java:231)
      org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:161)
      org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:165)
      org.jboss.remoting.Client.invoke(Client.java:1724)
      org.jboss.remoting.Client.invoke(Client.java:629)
      org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:243)
      org.jboss.ws.core.client.SOAPProtocolConnectionHTTP.invoke(SOAPProtocolConnectionHTTP.java:71)
      org.jboss.ws.core.CommonClient.invoke(CommonClient.java:340)
      org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:290)
      org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:170)
      org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
      $Proxy475.findDocumentsByPersonalNumber(Unknown Source)

       

      It is seriouse issues, beacause we are using lots of Web Services of other vendors and we must not depend on there systems stability. Request must time out after certains period not to stop other requests of that type. I understand workarounds for following scenarios can be done by executing in separate thread and than interrapting that thread, futures or something like that. But I think it is not straight way for this, because there are also some issues with it.

       

      Very simple to reproduce following scenario:

       

      Suppose you have written both client and server side of WS, run both server and client on the same JBoss 5.1. Invoke any method and than sleep in that method for undefined period of time, client will hang no matter transaction timeout will happen on server side or you will totally shut down that server (in case server was on other machine).