java - 使用CXF3.x出现的报错

 200355人 发布于 2022-11-02 15:49

四月 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)

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

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

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

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

    2022-11-12 01:50 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有