某日在启动dubbo工程时,出现了下面的错误:
- | 2017-10-31 14:01:45.859 | WARN | IBP_DB_01 | DubboServerHandler-172.22.67.231:21881-thread-1 | c.a.d.r.t.d.ChannelEventRunnable > 62 | | | [DUBBO] ChannelEventRunnable handle RECEIVED operation error, channel is NettyChannel [channel=[id: 0xf9182606, /127.0.0.1:56058 :> /127.0.0.1:21881]], message is status, dubbo version: dap-1.0, current host: 127.0.0.1 |
com.alibaba.dubbo.remoting.RemotingException: Failed to send message OK^Mdubbo> to /127.0.0.1:56058, cause: null
at com.alibaba.dubbo.remoting.transport.netty.NettyChannel.send(NettyChannel.java:108)
at com.alibaba.dubbo.remoting.transport.AbstractPeer.send(AbstractPeer.java:51)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:185)
at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52)
at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.nio.channels.ClosedChannelException: null
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.cleanUpWriteBuffer(AbstractNioWorker.java:433)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.writeFromUserCode(AbstractNioWorker.java:128)
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:99)
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:36)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:779)
at org.jboss.netty.channel.Channels.write(Channels.java:725)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.doEncode(OneToOneEncoder.java:71)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:59)
at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:784)
at org.jboss.netty.channel.SimpleChannelHandler.writeRequested(SimpleChannelHandler.java:292)
at com.alibaba.dubbo.remoting.transport.netty.NettyHandler.writeRequested(NettyHandler.java:99)
at org.jboss.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:254)
at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591)
at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:582)
at org.jboss.netty.channel.Channels.write(Channels.java:704)
at org.jboss.netty.channel.Channels.write(Channels.java:671)
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:348)
at com.alibaba.dubbo.remoting.transport.netty.NettyChannel.send(NettyChannel.java:98)
... 7 common frames omitted
- | 2017-10-31 14:01:45.859 | INFO | IBP_DB_01 | DubboServerHandler-172.22.67.231:21881-thread-1 | c.a.d.r.protocol.dubbo.DubboProtocol > 42 | | | [DUBBO] disconected from /127.0.0.1:56058,url:dubbo://172.22.67.231:21881/com.dap.sequence.SequenceGenerator?anyhost=true&application=sequence&channel.readonly.sent=true&codec=dubbo&default=true&default.queues=5000&default.retries=0&default.threadpool=cached&default.threads=200&default.timeout=10000&dubbo=dap-1.0&generic=false&heartbeat=60000&interface=com.dap.sequence.SequenceGenerator&logger=slf4j&methods=dropSequence,query,getSequence,queryDetail,createSequence,updateIncreasement,getBigIntSequence&pid=11388&revision=1.0.0-SNAPSHOT&side=provider×tamp=1509429704834, dubbo version: dap-1.0, current host: 127.0.0.1 |
- | 2017-10-31 14:01:47.840 | WARN | IBP_DB_01 | New I/O worker #2 | c.a.d.r.transport.AbstractServer > 54 | | | [DUBBO] All clients has discontected from /127.0.0.1:21881. You can graceful shutdown now., dubbo version: dap-1.0, current host: 127.0.0.1 |
而且,启动脚本方面还出现了下面的错误:
以上错误原因:根据排查,出现这种问题的机器的操作系统是redhat7,在redhat6上面没有发现此类问题。考虑到可能是nc的不同版本造成的。故试着把redhat6的nc安装到redhat7上面
处理办法:
1、卸载redhat7 上面的你nc包:rpm -e nmap-ncat-6.40-4.el7.x86_64 --nodeps
2、安装nc-1.84-24.el6.x86_64.rpm包:rpm -ivh nc-1.84-24.el6.x86_64.rpm
重新启动,不在出现上面的问题。