Error while receiving Chunked responses

jaimemm jaimemm at gmail.com
Tue Jan 13 09:15:47 EST 2009


I've forgot to say that the 2000 is the first line of the response's body
(bytes of the chunk)
With other http client the response is perfectly received (so it's not a
problem).


jaimemm wrote:
> 
> Hi,
> 
> I'm getting the following error while receiving chunked responses from a
> JBOSS server
> 
> ----------
> 13-Jan-2009 13:48:37 org.jboss.netty.channel.SimpleChannelHandler
> WARNING: EXCEPTION, please implement
> test.netty.HttpResponseHandler.exceptionCaught() for proper handling.
> java.lang.IllegalArgumentException: Invalid initial line: 2000
> 	at
> org.jboss.netty.handler.codec.http.HttpMessageDecoder.splitInitial(HttpMessageDecoder.java:231)
> 	at
> org.jboss.netty.handler.codec.http.HttpResponseDecoder.readInitial(HttpResponseDecoder.java:39)
> 	at
> org.jboss.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:80)
> 	at
> org.jboss.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:42)
> 	at
> org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:372)
> 	at
> org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:345)
> 	at
> org.jboss.netty.handler.codec.replay.ReplayingDecoder.handleUpstream(ReplayingDecoder.java:308)
> 	at
> org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:293)
> 	at
> org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:280)
> 	at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:299)
> 	at
> org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:244)
> 	at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:161)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:619)
> -------------
> 
> The code of the handler is as follows:
> 
> @ChannelPipelineCoverage("all")
> public class HttpResponseHandler extends SimpleChannelHandler {
> 	
> 	private BlockingQueue<Object[]> outboundQueue;
> 	private Object[] arr;
> 	
> 	public HttpResponseHandler(Object[] a,BlockingQueue<Object[]> q)
> 	{
> 		arr=a;
> 		outboundQueue=q;
> 		
> 	}
> 	
> 	@Override
> 	public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
> throws Exception {
> 		HttpResponse response = (HttpResponse) e.getMessage();
> 		
> 		
> 		System.out.println("HTTP Client - Response Received
> through:"+response.getContent().toString(Charset.defaultCharset().name()));
> 	        }
> }
> 
> Could anyone help?
> 
> Thanks
> 

-- 
View this message in context: http://n2.nabble.com/Error-while-receiving-Chunked-responses-tp2151225p2151317.html
Sent from the Netty User Group mailing list archive at Nabble.com.




More information about the netty-users mailing list