将解码消息从一个通道写入另一个通道会导致IllegalBufferAccessException异常

时间:2013-07-05 02:21:25

标签: exception proxy netty

我是netty的新手。我通过添加http编解码器处理程序来更改HexDumpProxy的示例,以将解码的http消息从服务器通道写入后端客户端通道,当客户端获得http响应时,它将解码消息并将响应消息写回inboundChannel(in messageReceived事件)。但这总是导致io.netty.buffer.IllegalBufferAccessException异常。我非常感谢你的帮助。谢谢你的时间。

io.netty.buffer.IllegalBufferAccessException     在io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:114)     at io.netty.handler.codec.http.DefaultFullHttpRequest.release(DefaultFullHttpRequest.java:69)     在io.netty.buffer.BufUtil.release(BufUtil.java:76)     at io.netty.channel.ChannelHandlerUtil.handleInboundBufferUpdated(ChannelHandlerUtil.java:62)     at io.netty.channel.ChannelInboundMessageHandlerAdapter.inboundBufferUpdated(ChannelInboundMessageHandlerAdapter.java:100)     at io.netty.channel.DefaultChannelHandlerContext.invokeInboundBufferUpdated(DefaultChannelHandlerContext.java:1031)     at io.netty.channel.DefaultChannelHandlerContext.fireInboundBufferUpdated0(DefaultChannelHandlerContext.java:998)     at io.netty.channel.DefaultChannelHandlerContext.fireInboundBufferUpdated(DefaultChannelHandlerContext.java:978)     at io.netty.channel.ChannelHandlerUtil.handleInboundBufferUpdated(ChannelHandlerUtil.java:69)     at io.netty.channel.ChannelInboundMessageHandlerAdapter.inboundBufferUpdated(ChannelInboundMessageHandlerAdapter.java:100)     at io.netty.channel.DefaultChannelHandlerContext.invokeInboundBufferUpdated(DefaultChannelHandlerContext.java:1031)     at io.netty.channel.DefaultChannelHandlerContext.fireInboundBufferUpdated0(DefaultChannelHandlerContext.java:998)     at io.netty.channel.DefaultChannelHandlerContext.fireInboundBufferUpdated(DefaultChannelHandlerContext.java:978)     at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:441)     at io.netty.handler.codec.ByteToMessageDecoder.inboundBufferUpdated(ByteToMessageDecoder.java:69)     at io.netty.channel.ChannelInboundByteHandlerAdapter.inboundBufferUpdated(ChannelInboundByteHandlerAdapter.java:46)     at io.netty.channel.CombinedChannelDuplexHandler.inboundBufferUpdated(combinedChannelDuplexHandler.java:175)     at io.netty.channel.DefaultChannelHandlerContext.invokeInboundBufferUpdated(DefaultChannelHandlerContext.java:1031)     at io.netty.channel.DefaultChannelHandlerContext.fireInboundBufferUpdated0(DefaultChannelHandlerContext.java:998)     at io.netty.channel.DefaultChannelHandlerContext.fireInboundBufferUpdated(DefaultChannelHandlerContext.java:978)     at io.netty.channel.DefaultChannelPipeline.fireInboundBufferUpdated(DefaultChannelPipeline.java:828)     at io.netty.channel.nio.AbstractNioByteChannel $ NioByteUnsafe.read(AbstractNioByteChannel.java:118)     在io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:429)     at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:392)     在io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:322)     at io.netty.util.concurrent.SingleThreadEventExecutor $ 2.run(SingleThreadEventExecutor.java:114)     在java.lang.Thread.run(未知来源)

1 个答案:

答案 0 :(得分:0)

自此版本以来API已更改..请使用最新版本4.0.0.CR9。