hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Help with Multiple Connections
Date Tue, 21 Feb 2012 14:11:55 GMT
On Mon, 2012-02-20 at 21:16 -0800, m0j0j0j0 wrote:
> Ive sorted my problem out i believe, thank you very much.
> 
> I still throw a few exceptions but it appears the httpclient is auto
> recovering from it as it should
> what i did was set the timeout improperly for the threads that initiate the
> get threads.  
> So far seems to be working perfect for me.
> 

This all makes no sense of so ever. java.lang.IllegalStateException:
'Connection pool shut down' is thrown because some piece of code in your
application shut down the connection manager, which is something that
should never happen if your application intends to continue using it.

Oleg


> m0j0j0j0 wrote:
> > 
> > Here is the stack trace
> > 
> > Exception in thread "pool-4-thread-488" java.lang.IllegalStateException:
> > Connection pool shut down
> > 	at
> > org.apache.http.impl.conn.tsccm.ConnPoolByRoute.getEntryBlocking(ConnPoolByRoute.java:346)
> > 	at
> > org.apache.http.impl.conn.tsccm.ConnPoolByRoute$1.getPoolEntry(ConnPoolByRoute.java:300)
> > 	at
> > org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager$1.getConnection(ThreadSafeClientConnManager.java:224)
> > 	at
> > org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:401)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:941)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:919)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:910)
> > 	at GetThread.run(HTTP_Con.java:125)
> > 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> > 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> > 	at java.lang.Thread.run(Unknown Source)
> > 
> > 
> > java.lang.IllegalStateException: Connection pool shut down
> > 	at
> > org.apache.http.impl.conn.tsccm.ConnPoolByRoute.getEntryBlocking(ConnPoolByRoute.java:346)
> > 	at
> > org.apache.http.impl.conn.tsccm.ConnPoolByRoute$1.getPoolEntry(ConnPoolByRoute.java:300)
> > 	at
> > org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager$1.getConnection(ThreadSafeClientConnManager.java:224)
> > 	at
> > org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:401)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:941)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:919)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:910)
> > 	at GetThread.run(HTTP_Con.java:125)
> > 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> > 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> > 	at java.lang.Thread.run(Unknown Source)
> > java.lang.IllegalStateException: Connection pool shut down
> > 	at
> > org.apache.http.impl.conn.tsccm.ConnPoolByRoute.getEntryBlocking(ConnPoolByRoute.java:346)
> > 	at
> > org.apache.http.impl.conn.tsccm.ConnPoolByRoute$1.getPoolEntry(ConnPoolByRoute.java:300)
> > 	at
> > org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager$1.getConnection(ThreadSafeClientConnManager.java:224)
> > 	at
> > org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:401)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:941)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:919)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:910)
> > 	at GetThread.run(HTTP_Con.java:125)
> > 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> > 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> > 	at java.lang.Thread.run(Unknown Source)
> > java.lang.IllegalStateException: Connection pool shut down
> > 	at
> > org.apache.http.impl.conn.tsccm.ConnPoolByRoute.getEntryBlocking(ConnPoolByRoute.java:346)
> > 	at
> > org.apache.http.impl.conn.tsccm.ConnPoolByRoute$1.getPoolEntry(ConnPoolByRoute.java:300)
> > 	at
> > org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager$1.getConnection(ThreadSafeClientConnManager.java:224)
> > 	at
> > org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:401)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:941)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:919)
> > 	at
> > org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:910)
> > 	at GetThread.run(HTTP_Con.java:125)
> > 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> > 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> > 	at java.lang.Thread.run(Unknown Source)
> > 
> > ----------------------------------------------------------------------
> > 
> > line 125 in HTTP_Con class i created is this line which is where the stack
> > trace points me 
> > but i dontknow what im doing wrong, i did a fair ammount of research
> > regarding httpclient4 and 
> > have tried everything, even removing my logic i use to process the data in
> > my get thread and 
> > simplifying it down to an alive check with exception handling everywhere,
> > consumeentity etc.. 
> > 
> > 
> > 
> > 			byte[] response = httpClient.execute(httpget, handler);
> > 
> > If you look in the original post i have this surrounded in a try catch
> > block, also i consumeentity to encourage resource release.
> > 
> > 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message