Oleg, 22-May-2010:07:56:19.310 scd2ntb215 main EXCEPTION AbunchOfOurInfo... ltu068_scd2ntb215_-1c64b48c:128bb71b989:-73d0 SYSTEM_EXCEPTION[Error making call[Error executing Remote Method=[addIncentive] for Service Url=[http://mymachine:9810/myurl] Exception=[java.lang.IllegalStateException: Connection already open. at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:135) at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:108) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:554) ....our code here ]]] com.mycompany.SystemException: Error making call[Error executing Remote Method=[addIncentive] for Service Url=[ http://mymachine:9810/myurl] Exception=[java.lang.IllegalStateException: Connection already open. at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:135) at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:108) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:554) ....our code here ------------Wrapped Exception----------- com.mycompany.RemoteServiceException: Error executing Remote Method=[addIncentive] for Service Url=[ http://mymachine:9810/myurl] Exception=[java.lang.IllegalStateException: Connection already open. at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:135) at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:108) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:554) ....our code here
Can't reproduce it right now because we only saw it a couple of times (during a performance test). I do have wire traces on, didn't see anything in there.. But I don't think I have context logging for connection management / request execution turned on. I'll see if I can get those on for the next test. -ken -----Original Message----- From: Oleg Kalnichevski [mailto:[email protected]] Sent: Tuesday, May 25, 2010 3:51 PM To: HttpClient User Discussion Subject: Re: java.lang.IllegalStateException: Connection already open On Tue, 2010-05-25 at 13:06 -0400, Brooks, Kenneth S wrote: > What would cause this: java.lang.IllegalStateException: Connection already > open > > Never saw this when using httpclient 3.x, recently upgraded to 4.0.1 and saw > this a few times while running performance tests. > > Here are all of the configurations used when constructing the client: > HttpParams httpParams = new BasicHttpParams(); > > HttpProtocolParams.setVersion(httpParams, HttpVersion.HTTP_1_1); > > ConnManagerParams.setMaxTotalConnections(httpParams, > ClientPropertyLocator.getInstance().getIntProperty(ClientPropertyLocator.HTTP_MAX_TOTAL_CONNECTIONS)); > ConnManagerParams.setMaxConnectionsPerRoute(httpParams, new > ConnPerRouteBean(ClientPropertyLocator.getInstance().getIntProperty(ClientPropertyLocator.HTTP_MAX_CONNECTIONS_PER_ROUTE))); > > HttpConnectionParams.setConnectionTimeout(httpParams, > ClientPropertyLocator.getInstance().getIntProperty(ClientPropertyLocator.HTTP_CONNECTION_TIMEOUT)); > HttpConnectionParams.setStaleCheckingEnabled(httpParams, > ClientPropertyLocator.getInstance().getBooleanProperty(ClientPropertyLocator.HTTP_STALE_CONNECTION_CHECK_ENABLED)); > HttpConnectionParams.setSoTimeout(httpParams, > ClientPropertyLocator.getInstance().getIntProperty(ClientPropertyLocator.HTTP_SOCKET_TIMEOUT)); > HttpConnectionParams.setLinger(httpParams, > ClientPropertyLocator.getInstance().getIntProperty(ClientPropertyLocator.HTTP_SO_LINGER)); > HttpConnectionParams.setTcpNoDelay(httpParams, > ClientPropertyLocator.getInstance().getBooleanProperty(ClientPropertyLocator.HTTP_TCP_NODELAY)); > > SchemeRegistry schemeRegistry = new SchemeRegistry(); > schemeRegistry.register(new Scheme("http", > PlainSocketFactory.getSocketFactory(), 80)); > > ClientConnectionManager clientConnectionManager = new > ThreadSafeClientConnManager(httpParams, schemeRegistry); > > IdleConnectionMonitorThread idleConnectionMonitorThread = new > IdleConnectionMonitorThread(clientConnectionManager); > > idleConnectionMonitorThread.setIdleConnectionTimeout(ClientPropertyLocator.getInstance().getIntProperty(ClientPropertyLocator.HTTP_IDLE_CONNECTION_TIMEOUT)); > > idleConnectionMonitorThread.setIdleConnectionCheckInterval(ClientPropertyLocator.getInstance().getIntProperty(ClientPropertyLocator.HTTP_IDLE_CONNECTION_CHECK_INTERVAL)); > idleConnectionMonitorThread.start(); > > httpClient = new DefaultHttpClient(clientConnectionManager, > httpParams); > > Kenneth, Could you please at the very least post the complete exception stack trace or try to reproduce the problem with the context logging for connection management / request execution turned on? For details on context logging see http://hc.apache.org/httpcomponents-client-4.0.1/logging.html Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] This transmission may contain information that is privileged, confidential, legally privileged, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. Although this transmission and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by JPMorgan Chase & Co., its subsidiaries and affiliates, as applicable, for any loss or damage arising in any way from its use. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you.
