hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brooks, Kenneth S" <kenneth.s.bro...@chase.com>
Subject java.lang.IllegalStateException: Connection already open
Date Tue, 25 May 2010 17:06:46 GMT
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);




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.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message