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 chaoticinc <ja...@rogers.com> on 2007/06/05 00:20:58 UTC
REUSE_HTTP_CLIENT as 'true' causes client to hang
Hello,
I apologize if this problem is a repeat. I found nothing that I could relate
to as being the same issue.
I have a working Axis 2 version 1.2 client that I am now trying to make
reuse an HTTP connection.
If I set the REUSE_HTTP_CLIENT to false all is good and messages are sent
and retrieved, but when I set REUSE_HTTP_CLIENT to true I get two
connections made, two responses received and then the client hangs with the
top of the stack trace being:
Object.wait(long) line: not available [native method]
MultiThreadedHttpConnectionManager.doGetConnection(HostConfiguration, long)
line: 509
...
I am guessing connections aren't returned to a pool for some reason. Is this
a known issue or am I doing something wrong? The following is the code
snippet.
Options communicationOptions = new Options();
communicationOptions.setTo( targetEPR );
communicationOptions.setTransportInProtocol( Constants.TRANSPORT_HTTP );
communicationOptions.setProperty( HTTPConstants.REUSE_HTTP_CLIENT, true );
HttpClient httpClient = new HttpClient( new
MultiThreadedHttpConnectionManager() );
ConfigurationContext context;
try
{
context = ConfigurationContextFactory.
createConfigurationContextFromFileSystem(null, null);
context.setProperty( HTTPConstants.CACHED_HTTP_CLIENT, httpClient );
}
catch (AxisFault e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
Jayke
--
View this message in context: http://www.nabble.com/REUSE_HTTP_CLIENT-as-%27true%27-causes-client-to-hang-tf3868379.html#a10959700
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: REUSE_HTTP_CLIENT as 'true' causes client to hang
Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Jayke,
you set the HTTPConstants.REUSE_HTTP_CLIENT property in the wrong place.
You should set it into the conf. context, not into the options.
Michele
On Mon, 2007-06-04 at 15:20 -0700, chaoticinc wrote:
> Hello,
>
> I apologize if this problem is a repeat. I found nothing that I could relate
> to as being the same issue.
>
> I have a working Axis 2 version 1.2 client that I am now trying to make
> reuse an HTTP connection.
> If I set the REUSE_HTTP_CLIENT to false all is good and messages are sent
> and retrieved, but when I set REUSE_HTTP_CLIENT to true I get two
> connections made, two responses received and then the client hangs with the
> top of the stack trace being:
>
> Object.wait(long) line: not available [native method]
> MultiThreadedHttpConnectionManager.doGetConnection(HostConfiguration, long)
> line: 509
> ...
>
> I am guessing connections aren't returned to a pool for some reason. Is this
> a known issue or am I doing something wrong? The following is the code
> snippet.
>
> Options communicationOptions = new Options();
> communicationOptions.setTo( targetEPR );
> communicationOptions.setTransportInProtocol( Constants.TRANSPORT_HTTP );
> communicationOptions.setProperty( HTTPConstants.REUSE_HTTP_CLIENT, true );
>
> HttpClient httpClient = new HttpClient( new
> MultiThreadedHttpConnectionManager() );
> ConfigurationContext context;
> try
> {
> context = ConfigurationContextFactory.
> createConfigurationContextFromFileSystem(null, null);
> context.setProperty( HTTPConstants.CACHED_HTTP_CLIENT, httpClient );
> }
> catch (AxisFault e)
> {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>
>
> Jayke
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org