当前位置:   article > 正文

dubbo 20880端口被占用的几种解决方案记录

dubbo 20880

dubbo 20880端口被占用的两种解决方案记录

学习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
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27

第一种:查找谁占用的端口号

1.打开命令窗口

win + r
cmd
  • 1
  • 2

2.查找是谁占用的端口

netstat -ano | findstr 20880
  • 1

在这里插入图片描述
可以看到我的是被pid为7472占用的端口

3.杀死这个进程

taskkill /F  /pid 7472
  • 1

在这里插入图片描述
然后重新运行顺利解决

第二种:改dubbo的端口号

将20880端口改为其他的,我改为20881端口就解决了。

<dubbo:protocol name="dubbo" port="20881"/>
  • 1
参考博文
  1. https://blog.csdn.net/u011501574/article/details/107537029?utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2allsobaiduend~default-3-107537029.nonecase&utm_term=dubbo20880%E8%A2%AB%E5%8D%A0%E7%94%A8&spm=1000.2123.3001.4430
声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号