使用CXF3.x出现的报错


四月 10, 2015 3:05:33 上午 org.apache.cxf.transport.http.netty.server.NettyHttpServletHandler exceptionCaught
严重: Unexpected exception from downstream in Netty servlet handler, due to: {0}.
java.io.IOException: 远程主机强迫关闭了一个现有的连接。
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(Unknown Source)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.read(Unknown Source)
at sun.nio.ch.SocketChannelImpl.read(Unknown Source)
at io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:446)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:871)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:224)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:108)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:494)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:461)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:378)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at java.lang.Thread.run(Unknown Source)

java cxf netty

起名字好烦 9 years, 10 months ago

出现这个问题原因是:
说明连接被强断了,没有通过协议交互调用close方法。
客户端自己关闭了连接,(没有调用SocketChannel的close方法。比如一些暴力断开方式,如拔网线,进程直接kill掉,或者windows下ctrl+c。),服务器还在read事件中,这个时候读取客户端的时候会报错。

我觉得问题已经很清楚了吧?


 java


 Unexpected exception from downstream in Netty servlet handler, due to: {0}

netty向外发送数据的时候发生了异常。
应该是启动方式的不对。具体的能把启动的源代码贴出来看一下吗?没有源码怎么知道错误位置呢?
我现在的公司目前也是使用的apache cxf。可以多交流。

五月的一天 answered 9 years, 10 months ago

Your Answer