hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tov Are Jacobsen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HTTPCLIENT-756) HttpClient v 4 Alpha 3: WARNING: Invalid use of SingleClientConnManager: connection still allocated.
Date Sat, 08 Mar 2008 19:19:46 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12576583#action_12576583
] 

Tov Are Jacobsen commented on HTTPCLIENT-756:
---------------------------------------------

Thanks,

I didn't see that one :)

mvh,

Tov Are




-- 
-- 
Med vennlig hilsen
Tov Are Jacobsen
Tlf: 995 40 550


> HttpClient v 4 Alpha 3: WARNING: Invalid use of SingleClientConnManager: connection still
allocated.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-756
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-756
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.0 Alpha 3
>         Environment: Windows XP Professional  / Eclipse 3.2 / JDK 1.6
> commons-codec-1.3.jar
> commons-email-1.1.jar
> commons-lang-2.3.jar
> commons-logging-1.1.1.jar
> commons-logging-adapters-1.1.1.jar
> commons-logging-api-1.1.1.jar
> commons-logging-tests.jar
> httpclient-4.0-alpha3.jar
> httpcore-4.0-beta1.jar
> httpcore-nio-4.0-beta1.jar
> httpmime-4.0-alpha3.jar
>            Reporter: Tov Are Jacobsen
>            Priority: Minor
>
> I get a warning and exception even though the connection has been consumed.
> The code is listed here as well.
> http://code.google.com/p/tovare/source/browse/trunk/src/com/tovare/bugs/ReproduceConnectionError.java
> You can check out with subversion using (complete with libs):
> svn checkout http://tovare.googlecode.com/svn/trunk/ tovare-read-only
> (Note: The code yields the same result with a regular http request, rather than https
as in the code).
> /*
>  * ReproduceConnectionError.java
>  */
> //
> // JDK Compliance: JDK 6.0 
> //
> //First page: HTTP/1.1 200 OK
> //07.mar.2008 23:06:12 org.apache.http.impl.conn.SingleClientConnManager revokeConnection
> //WARNING: Invalid use of SingleClientConnManager: connection still allocated.
> //Make sure to release the connection before allocating another one.
> //java.lang.IllegalStateException: Revoking connection to HttpRoute[{}->http://www.yahoo.com]
> //	at org.apache.http.impl.conn.SingleClientConnManager.revokeConnection(SingleClientConnManager.java:345)
> //	at org.apache.http.impl.conn.SingleClientConnManager.getConnection(SingleClientConnManager.java:220)
> //	at org.apache.http.impl.conn.SingleClientConnManager.getConnection(SingleClientConnManager.java:195)
> //	at org.apache.http.impl.client.DefaultClientRequestDirector.allocateConnection(DefaultClientRequestDirector.java:508)
> //	at org.apache.http.impl.client.DefaultClientRequestDirector.execute(DefaultClientRequestDirector.java:293)
> //	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:500)
> //	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:455)
> //	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:421)
> //	at com.tovare.bugs.ReproduceConnectionError.main(ReproduceConnectionError.java:43)
> //Second page: HTTP/1.1 200 OK
> package com.tovare.bugs;
> import java.io.*;
> import java.net.URISyntaxException;
> import java.util.List;
> import org.apache.http.HttpEntity;
> import org.apache.http.HttpResponse;
> import org.apache.http.client.*;
> import org.apache.http.client.params.ClientPNames;
> import org.apache.http.client.params.CookiePolicy;
> import org.apache.http.cookie.Cookie;
> import org.apache.http.client.methods.*;
> import org.apache.http.impl.client.DefaultHttpClient;
> import org.apache.http.HttpException;
> /**
>  * Trying to reproduce a bug.
>  * 
>  * @author Tov Are Jacobsen
>  *
>  */
> public class ReproduceConnectionError {
> 	/**
> 	 * @param args
> 	 */
> 	public static void main(String[] args) throws Exception{
> 		DefaultHttpClient client = new DefaultHttpClient();
> 		client.getParams().setParameter(
>                 ClientPNames.COOKIE_POLICY,
>                 CookiePolicy.BROWSER_COMPATIBILITY);
> 		HttpGet authget = new HttpGet("https://www.yahoo.com/");
> 		HttpResponse resp = client.execute(authget);
> 		HttpEntity ent = resp.getEntity();
> 		if (ent == null) ent.consumeContent();
> 		System.out.println("First page: " + resp.getStatusLine().toString()); 
> 		
> 		HttpGet authget2 = new HttpGet("https://www.yahoo.com/");
> 		HttpResponse resp2 = client.execute(authget2);
> 		HttpEntity ent2 = resp2.getEntity();
> 		if (ent2 == null) ent2.consumeContent();
> 		System.out.println("Second page: " + resp2.getStatusLine().toString()); 
> 		
> 	}
> }
> Regards,
> Tov Are

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message