You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Doug B <um...@gmail.com> on 2010/05/28 07:14:50 UTC

Axis2 (1.5.1): JAX-WS Client connection tuning, best practices, Connection timeouts

We're using Axis as a JAX-WS implementation (under WebSphere 6.1, if
that matters), so we're not writing any Axis-specific code ourselves.

On Axis2 1.4, we observed many sockets being opened and staying open
long after use and we had some kind of problem that led us to this
ticket https://issues.apache.org/jira/browse/AXIS2-4330 and upgrading
to 1.5.1.

As part of that change, we also modified our code to use a singleton
javax.xml.ws.Service and only call its get...PortTypeEP() (which calls
Service.getPort()) on each request.

Doing this, we now no longer see socket growth, but after a small
number of requests, we receive this error:

org.apache.commons.httpclient.ConnectionPoolTimeoutException: Timeout
waiting for connection

Now, this thread seems relevant:

http://www.mail-archive.com/axis-user@ws.apache.org/msg49949.html

But, since we're using JAX-WS code, not our own, we don't have the
ability to make Axis-specific configuration calls for such things. Can
I do this in axis2.xml? If so, where do I need to place it for a
client deployment?

Furthermore, I'm not sure which kinds of settings actually address the
problem without removing the whole benefit of reused sockets. For
instance, if I'm able to use settings like these, described in that
thread:

        ConfigurationContext context =
this.client.getServiceContext().getConfigurationContext();
        context.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, true);
        context.setProperty(HTTPConstants.CACHED_HTTP_CLIENT,
this.httpClient);
        context.setProperty(HTTPConstants.AUTO_RELEASE_CONNECTION, true);

Am I any better off than simply creating new Service instances and the
new sockets with them?

Am I totally misunderstanding how to use the library properly? Or is
the JAX-WS implementation flawed by not cleaning up after itself? I
certainly wouldn't have expected a shared Service instance to exhibit
this limit of 2 sockets with its default settings.

Thanks for any assistance.
Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org