1 Reply Latest reply on Jul 17, 2012 9:16 PM by ron_sigal

    Is there a way to avoid a proxy server closing Jboss HTTPS connection on long requests?

    klease

      We have a client/server application running on Jboss 5.1.0.GA with JbossRemoting 2.5.3.SP1.

      Clients make remote EJB3 calls to the server using https which is routed through a proxy server.

      The jndi.properties includes this:

      java.naming.factory.initial=org.jboss.naming.HttpNamingContextFactory

      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

      java.naming.provider.url=https://SERVER:443/unified-invoker/SSLJNDIFactory/?dataType=invocation&return-exception=true

       

      On some remote calls which run for several minutes, the proxy server terminates the HTTPS connection from the client. On the client side, we receive an exception like this:

      Caused by: java.net.SocketException: Unexpected end of file from server

          at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)

          at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)

          at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)

          at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)

          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

          at java.net.HttpURLConnection.getResponseCode(Unknown Source)

          at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)

          at org.jboss.remoting.transport.http.HTTPClientInvoker.getResponseCode(HTTPClientInvoker.java:1269)

          at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:351)

          at org.jboss.remoting.transport.http.HTTPClientInvoker.makeInvocation(HTTPClientInvoker.java:232)

      The server method continues to run but of course no results can be returned to the client.

       

      Is there any way to have the jboss client or server layers "keep the connection alive" while waiting for the method to terminate, which would avoid the proxy server closing the connection?

      The obvious solution would be to increase the proxy timeout, but we don't have direct control over it.

      Any suggestions would be greatly appreciated.

      If there is no way to do this with current Jboss Remoting, is it possible in a more recent version of Jboss ?

        • 1. Re: Is there a way to avoid a proxy server closing Jboss HTTPS connection on long requests?
          ron_sigal

          Hi Karen,

           

          Unfortunately, I don't know of any obvious way to solve your problem.   If we were talking about a pure Remoting application (i.e., direct use of Remoting, rather than indirect use by way of EJBs), I would think of some kind of asynchronous architecture.  I.e., you make the invocation and get a URL back pointing to the eventual result.  Now, if you want to get crazy, you could wrap the EJB3 invocation handler, org.jboss.aspects.remoting.AOPRemotingInvocationHandler (see the configuration file $JBOSS_HOME/server/$CONFIG/deploy/ejb3-connections-jboss-beans.xml), in your own handler which caches results and returns a URL.  Then, when it sees the URL, it returns the result, or an indication that the result isn't ready yet.  It sounds like fun, kinda.

           

          The latest version, Remoting 3, is a completely different code base that I don't know much about.

           

          Sorry I couldn't help.

           

          -Ron