我是netty的新手。我更改了HexDumpProxy的示例,添加了http编解码器处理程序,将解码后的http消息从服务器通道写入后端客户端通道,当客户端获得http响应时,它将解码该消息并将响应消息写回inboundChannel (在messageReceived事件中)。但这总是会导致io.netty.buffer.IllegalBufferAccessException异常。我将非常感谢你的任何帮助。耽误您时间,实在对不起。
io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:114) at io.netty.handler.codec.http.DefaultFullHttpRequest.release(DefaultFullHttpRequest.java:69) at 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的io.netty.buffer.IllegalBufferAccessExceptionio.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)的.java:1031)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) atio.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) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:429) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:392) atio.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:114) at java.lang.Thread.run的io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:322) (未知源)
发布于 2013-07-07 03:04:35
自此版本以来,API已发生变化。请使用4.0.0.CR9的最新版本。
https://stackoverflow.com/questions/17480222
复制相似问题