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: java.io.IOException: Bad chunk size??
Date Thu, 08 Nov 2007 13:55:15 GMT

On Thu, 2007-11-08 at 05:47 -0800, AlliumPorrum wrote:
> Ok, found the problem. And, unfortunately, it was in my own client code...
> 
> I have a few TimerTask's that request some data every now and then from a
> website. All TimerTask's run in own threads, but due one mistake in my code,
> they all shared the same instance of HTTPClient. 

And they actually should. You just have to make sure that instance is
using a thread-safe connection manager such as
MultithreadedHttpConnectionManager.

Oleg


> Crash-boom-bang! I changed
> the code so that now every thread has own HTTPClient and everything works
> just fine.
> 
> Sorry & thanks ;=)
> 
> 
> 
> AlliumPorrum wrote:
> > 
> > Hi!
> > 
> > I'm all the time getting following exception from
> > org.apache.commons.httpclient.ChunkedInputStream when I try to read a line
> > from the stream:
> > 
> > 18:26:21.241 > CourseParser: ***** java.io.IOException: Bad chunk size:
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> > java.io.IOException: Bad chunk size: <!DOCTYPE HTML PUBLIC "-//W3C//DTD
> > HTML 4.01 Transitional//EN">
> > at
> > org.apache.commons.httpclient.ChunkedInputStream.getChunkSizeFromInputStream(ChunkedInputStream.java:305)
> > at
> > org.apache.commons.httpclient.ChunkedInputStream.nextChunk(ChunkedInputStream.java:220)
> > at
> > org.apache.commons.httpclient.ChunkedInputStream.read(ChunkedInputStream.java:175)
> > at java.io.FilterInputStream.read(FilterInputStream.java:116)
> > at
> > org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:107)
> > at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
> > at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
> > at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
> > at java.io.InputStreamReader.read(InputStreamReader.java:167)
> > at java.io.BufferedReader.fill(BufferedReader.java:136)
> > at java.io.BufferedReader.readLine(BufferedReader.java:299)
> > at java.io.BufferedReader.readLine(BufferedReader.java:362)
> > 
> > I have read HTTP client documentations and searched hours from internet,
> > but I just can't find the solution. Could someone please tell me what
> > should I do to fix this issue??
> > 
> 


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


Mime
View raw message