users@glassfish.java.net

Re: KeepAliveFailure using .net proxies to access JAX-WS web service

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Tue, 26 Jun 2007 13:55:41 -0400

Hi,

glassfish_at_javadesktop.org wrote:
> When I use generated .net proxy classes to access my JAX_WS web service, I get this exception from the proxy after 15 seconds elapses from the time I make my first service call:
>
> The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.
>
> I've googled the heck out of this for some resolution that would involve changing my .net code, but the only solution that I can find is to disable keep-alive in my proxy class. However, since I am using basic authentication, it is required that the proxies use keep-alive and this disabling is not an option.
>
> If I could increase the keep-alive time to forever, then I think the error would go away. So I go into the glassfish admin panel and go to Configuration->HTTP Service->Keep Alive tab, I see the timeout value and I change it to 999999. This seems to fix my problem, But I am curious to know how I can work with a reasonable keep-alive value like 15 or 30 seconds.
> [Message sent by forum member 'atappert' (atappert)]

This value is the time Grizzly will hold your idle connection. If your
client isn't sending anything for 30 seconds (the default) or if you
open a connection and send more than 250 (the default) request, Grizzly
will close it to free the resource allocated (all WebServer does that).
Now just to understand, your WS client is unable to handle the case
where the connection is closed? Kind of sad as all http clients
(browsers, java clients) handle that case by usually re-opening the
connection.

The higher the value is, the higher the connection (and its associated
resources) will be kept in memory. That means performance might be
impacted if you have 10000 idle connections. I recommend a value between
60 seconds and 120 seconds (not more) to avoid wasting resources.

Thanks

-- Jeanfrancois


>
> http://forums.java.net/jive/thread.jspa?messageID=224031
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>