赞
踩
学习dubbo的时候发现dubbo的20880端口被占用了,下面提供目前我所知的两种种解决方案,如有错误,欢迎指正~
Caused by: com.alibaba.dubbo.remoting.RemotingException: Failed to bind NettyServer on /*.*.*.*:20880, cause: Failed to bind to: /0.0.0.0:20880 at com.alibaba.dubbo.remoting.transport.AbstractServer.<init>(AbstractServer.java:73) at com.alibaba.dubbo.remoting.transport.netty.NettyServer.<init>(NettyServer.java:63) at com.alibaba.dubbo.remoting.transport.netty.NettyTransporter.bind(NettyTransporter.java:33) at com.alibaba.dubbo.remoting.Transporter$Adpative.bind(Transporter$Adpative.java) at com.alibaba.dubbo.remoting.Transporters.bind(Transporters.java:48) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchanger.bind(HeaderExchanger.java:41) at com.alibaba.dubbo.remoting.exchange.Exchangers.bind(Exchangers.java:63) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.createServer(DubboProtocol.java:329) ... 34 more Caused by: org.jboss.netty.channel.ChannelException: Failed to bind to: /0.0.0.0:20880 at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272) at com.alibaba.dubbo.remoting.transport.netty.NettyServer.doOpen(NettyServer.java:94) at com.alibaba.dubbo.remoting.transport.AbstractServer.<init>(AbstractServer.java:68) ... 41 more Caused by: java.net.BindException: Address already in use: bind at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:437) at sun.nio.ch.Net.bind(Net.java:429) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193) at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:366) at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:290) at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42) ... 3 more
1.打开命令窗口
win + r
cmd
2.查找是谁占用的端口
netstat -ano | findstr 20880
可以看到我的是被pid为7472占用的端口
3.杀死这个进程
taskkill /F /pid 7472
然后重新运行顺利解决
将20880端口改为其他的,我改为20881端口就解决了。
<dubbo:protocol name="dubbo" port="20881"/>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。