hello netty在浏览器正常输出,但是控制台出现异常

来源:3-5 hello服务器启动与讲解

Mr_hongwei

2019-11-04

图片描述

十一月 04, 2019 11:19:48 下午 io.netty.channel.DefaultChannelPipeline onUnhandledInboundException
警告: An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.io.IOException: Connection reset by peer
	at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
	at sun.nio.ch.IOUtil.read(IOUtil.java:192)
	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
	at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:247)
	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1147)
	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514)
	at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:745)

/0:0:0:0:0:0:0:1:52182
/0:0:0:0:0:0:0:1:52182
/0:0:0:0:0:0:0:1:52183
/0:0:0:0:0:0:0:1:52183
/0:0:0:0:0:0:0:1:52186
/0:0:0:0:0:0:0:1:52186
/0:0:0:0:0:0:0:1:52186
/0:0:0:0:0:0:0:1:52186
写回答

1回答

风间影月

2019-11-04

检查一下使用的管道类型,还有其他的一些类,之前有同学写错会引起,比对一下源码的就行

1
4
Mr_hongwei
回复
风间影月
Debug发现用浏览器访问会出现4次请求,有2次报异常。看来还是用curl命令或者postman吧
2019-11-05
共4条回复

Netty+Spring Boot仿微信-全栈开发高性能后台及客户端

SpringBoot/Netty+MUI全栈开发 同时搞定后台+ Android&iOS

1498 学习 · 684 问题

查看课程