Web tier: servlets, JSP, Web frameworks: Pooling Http Connections - java.net.ProtocolException: Cannot wr

  1. Hi,

    Is it possible to pool HttpConnections as we pool Database Connections.

    I created a pool of 5 HttpConnection Objects. It works fine for the first 5 times(ITs creating a new objects). 6th Time the pool is called it will try to give an already used HttpConnection. When i try to Post Data to this connection i get an error.

    java.net.ProtocolException: Cannot write output after reading input.

    Am i missing something ??

  2. Are you using the correct http-headers? (Connection: keep-alive, etc...) Normally, when a request is made, the connection is closed by the webserver automatically.

  3. Have u got any solution for this problem? Even i want to do the same thing. hw r u creating http connection pooling and how r u managing this.