You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Glauber Matos (JIRA)" <ji...@apache.org> on 2008/04/21 18:31:21 UTC

[jira] Created: (HTTPCLIENT-762) Attempted read from closed stream - when reading entity.getContent()

Attempted read from closed stream - when reading entity.getContent() 
---------------------------------------------------------------------

                 Key: HTTPCLIENT-762
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-762
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient
    Affects Versions: 4.0 Alpha 3
         Environment: Windows XP SP2, JAVA 6.0;
            Reporter: Glauber Matos


Error when I' try to ready the content of HttpEntity by, EntityUtils.toString(entity);

Exception in thread "main" java.io.IOException: Attempted read from closed stream.
	at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:164)
	at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:159)
	at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
	at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
	at sun.nio.cs.StreamDecoder.read(Unknown Source)
	at java.io.InputStreamReader.read(Unknown Source)
	at java.io.Reader.read(Unknown Source)
	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:135)
	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:146)
	at br.com.brunobraga.bolsa.modulos.webnavigator.negocio.Teste2.main(Teste2.java:58)

-- 
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


[jira] Updated: (HTTPCLIENT-762) Attempted read from closed stream - when reading entity.getContent()

Posted by "Glauber Matos (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Glauber Matos updated HTTPCLIENT-762:
-------------------------------------

    Description: 
Error when I' try to read the content of HttpEntity by, EntityUtils.toString(entity);

Exception in thread "main" java.io.IOException: Attempted read from closed stream.
	at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:164)
	at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:159)
	at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
	at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
	at sun.nio.cs.StreamDecoder.read(Unknown Source)
	at java.io.InputStreamReader.read(Unknown Source)
	at java.io.Reader.read(Unknown Source)
	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:135)
	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:146)
	at br.com.brunobraga.bolsa.modulos.webnavigator.negocio.Teste2.main(Teste2.java:58)

  was:
Error when I' try to ready the content of HttpEntity by, EntityUtils.toString(entity);

Exception in thread "main" java.io.IOException: Attempted read from closed stream.
	at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:164)
	at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:159)
	at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
	at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
	at sun.nio.cs.StreamDecoder.read(Unknown Source)
	at java.io.InputStreamReader.read(Unknown Source)
	at java.io.Reader.read(Unknown Source)
	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:135)
	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:146)
	at br.com.brunobraga.bolsa.modulos.webnavigator.negocio.Teste2.main(Teste2.java:58)


> Attempted read from closed stream - when reading entity.getContent() 
> ---------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-762
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-762
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.0 Alpha 3
>         Environment: Windows XP SP2, JAVA 6.0;
>            Reporter: Glauber Matos
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Error when I' try to read the content of HttpEntity by, EntityUtils.toString(entity);
> Exception in thread "main" java.io.IOException: Attempted read from closed stream.
> 	at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:164)
> 	at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:159)
> 	at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
> 	at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
> 	at sun.nio.cs.StreamDecoder.read(Unknown Source)
> 	at java.io.InputStreamReader.read(Unknown Source)
> 	at java.io.Reader.read(Unknown Source)
> 	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:135)
> 	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:146)
> 	at br.com.brunobraga.bolsa.modulos.webnavigator.negocio.Teste2.main(Teste2.java:58)

-- 
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


[jira] Closed: (HTTPCLIENT-762) Attempted read from closed stream - when reading entity.getContent()

Posted by "Glauber Matos (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Glauber Matos closed HTTPCLIENT-762.
------------------------------------

       Resolution: Invalid
    Fix Version/s: 4.0 Alpha 3

Solved.
I'm trying to use System.out.println(EntityUtils.toString(entity)); after   entity.consumeContent();

Just use it before   entity.consumeContent();

> Attempted read from closed stream - when reading entity.getContent() 
> ---------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-762
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-762
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.0 Alpha 3
>         Environment: Windows XP SP2, JAVA 6.0;
>            Reporter: Glauber Matos
>             Fix For: 4.0 Alpha 3
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Error when I' try to read the content of HttpEntity by, EntityUtils.toString(entity);
> Exception in thread "main" java.io.IOException: Attempted read from closed stream.
> 	at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:164)
> 	at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:159)
> 	at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
> 	at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
> 	at sun.nio.cs.StreamDecoder.read(Unknown Source)
> 	at java.io.InputStreamReader.read(Unknown Source)
> 	at java.io.Reader.read(Unknown Source)
> 	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:135)
> 	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:146)
> 	at br.com.brunobraga.bolsa.modulos.webnavigator.negocio.Teste2.main(Teste2.java:58)

-- 
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