io.netty.util.IllegalReferenceCountException: refCnt: 0, increment: 1

Stack Overflow | Jianchao.Chen | 9 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Netty UDP, the reference count of a message is already 0 when I received it

    Stack Overflow | 9 months ago | Jianchao.Chen
    io.netty.util.IllegalReferenceCountException: refCnt: 0, increment: 1

    Root Cause Analysis

    1. io.netty.util.IllegalReferenceCountException

      refCnt: 0, increment: 1

      at io.netty.buffer.AbstractReferenceCountedByteBuf.retain()
    2. Netty
      WrappedByteBuf.retain
      1. io.netty.buffer.AbstractReferenceCountedByteBuf.retain(AbstractReferenceCountedByteBuf.java:63)
      2. io.netty.buffer.WrappedByteBuf.retain(WrappedByteBuf.java:799)
      2 frames
    3. com.boer.handler
      ActorMessageHandler.channelRead
      1. com.boer.handler.ActorMessageHandler.channelRead(ActorMessageHandler.java:44)
      1 frame
    4. Netty
      DefaultThreadFactory$DefaultRunnableDecorator.run
      1. io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
      2. io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
      3. io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
      4. io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
      5. io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
      6. io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787)
      7. io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:92)
      8. io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
      9. io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
      10. io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
      11. io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
      12. io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
      13. io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
      13 frames
    5. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)
      1 frame