This question really has two parts.  Is httpclient the correct
solution for this problem, and if it is, how do I use it correctly?

I've written an app in a weblogic 8.1 environment which converts user
input into an http request to a remote server.  This app is
occasionally getting stuck in a FIN WAIT-2 (as reported by netstat -a)
state during a session with the remote server.  This causes weblogic
to get stuck waiting, using up a weblogic thread.  After enough
waiting sessions, there are no threads left for weblogic to do its
work, and everything, all apps, on the weblogic server hangs.

A weblogic consultant at our company suggested that the problem was
the code I had written to create an http connection.  My code used
java.net.HttpURLConnection, and the consultant told me that I would be
better off moving away from java.net as the native java api does not
manage timeouts well.

As such, I've started using HttpClient in my code, with two timeouts
set (like so):

        HttpClientParams params = new HttpClientParams();
        // 10 seconds
        params.setSoTimeout(10000);
        // 20 seconds
        params.setConnectionManagerTimeout(20000);
        HttpClient client = new HttpClient(params);
        PostMethod method = new PostMethod(_urlString);
        // and now make a POST request using this method.

Unfortunately, this has not fixed my problem.

Now, the FIN-WAIT state is something happening in the TCP protocol,
rather than HTTP, which suggests that HttpClient is not the solution
to my problem.  But it was suggested to me by someone I consider an
expert, so its very possible that I'm just not setting the correct
timeouts or I'm otherwise using HttpClient incorrectly to address my
problem.

Is HttpClient the right solution for this FIN-WAIT problem?  If so,
how can I use it to close connections properly?

--Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to