hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Qiang Zhou" <genius...@gmail.com>
Subject Re: Connection is not open
Date Sun, 14 May 2006 13:54:22 GMT
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();
   }


2006/5/12, Roland Weber <http-async@dubioso.net>:
>
> 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: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message