IllegalStateException in FrameDecoder

"이희승 (Trustin Lee)" trustin at gmail.com
Thu May 26 07:37:12 EDT 2011


Your decoder did not advance the readerIndex of the buffer - i.e. you 
read zero byte.  You decoded a message from zero byte, and that's 
irrational and may lead to infinite loop.  Therefore, FrameDecoder 
detects the situation and triggers an exception.  It often means you did 
read something from the buffer, but you did not update the readerIndex 
of the buffer properly.

On 05/26/2011 08:30 PM, Abraham Menacherry wrote:
> Hi,
>
> I am sometimes getting the following exception while decoding a binary
> packet. Can somebody explain root cause of this exception?
>
> 2011-05-26 16:26:40,687 51 ERROR netty.DefaultHandler Exception occurred in
> Default Handler:
> java.lang.IllegalStateException: decode() method must read at least one byte
> if it returned a frame (caused by: class
> com.appcapture.buildingmgr.netty.DeviceProtocolMultiplexer)
> 	at
> org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:294)
> 	at
> org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:216)
> 	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)
> 	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)
> 	at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:350)
> 	at
> org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:281)
> 	at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:201)
> 	at
> org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46)
> 	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)
>
> --
> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/IllegalStateException-in-FrameDecoder-tp6406604p6406604.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users


-- 
Trustin Lee, http://gleamynode.net/


More information about the netty-users mailing list