On Sun, 2006-05-14 at 21:54 +0800, Qiang Zhou wrote:
> Hello:
>    At end of program mean after client.executeMehtod() and
> getResponseStream() method. Not the realy last line in my whole program. For
> example:
>    GetMethod method = new GetMethod(http://www.apache.org);
>    Httpclient client =new Httpclient();
>    try {
>       client.executeMethod(method);
>       // Read repsone content.
>       ...Follow the redirect When response.statusCode=302
>    }
>    catch(Exception e) {
>    }
>    finally {
>       if(method!=null)
>           method.releaseConnection();
>    }
> 

Qiang,

You are not calling this code from multiple threads, are you? Please
note HttpClient is thread safe only when used with a thread safe
connection manager such MultiThreadedHttpConnectionManager. The simple
connection manager used per default is NOT thread safe.

Oleg

> 
> 2006/5/12, Roland Weber <[EMAIL PROTECTED]>:
> >
> > Hello,
> >
> > >    When i invoke  releaseConnection method at end program. But system
> > throw
> > > an java.lang.IllegaStateException: Connection is not open!!!
> >
> > Do not release the connection at the end of the program.
> > Release the connection after each request you execute,
> > as shown in the tutorial.
> >
> > http://jakarta.apache.org/commons/httpclient/tutorial.html
> >
> > cheers,
> > Roland
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >


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

Reply via email to