报错日志:
Exception in thread "main" com.alibaba.dubbo.rpc.RpcException:
Fail to start server(url: dubbo://192.168.1.13:20880/com.sear
chservice22.test.service.HelloT?anyhost=true&application=dubb
oservicetest&bind.ip=192.168.1.13&bind.port=20880&channel.readonly
.sent=true&codec=dubbo&dubbo=2.5.7&generic=false&heartbeat=60000&interface
=com.searchservice22.test.service.HelloT&methods=sayhello&pid=16976&revision=
1.0&side=provider×tamp=1600252723861&version=1.0) Failed to bind NettySe
rver on /192.168.1.13:20880, cause: Failed to bind to: /0.0.0.0:20880
Caused by: com.alibaba.dubbo.remoting.RemotingException: Failed to bind NettyServer on /192.168.1.13:20880, cause: Failed to bind to: /0.0.0.0:20880
Caused by: org.jboss.netty.channel.ChannelException: Failed to bind to: /0.0.0.0:20880
Caused by: java.net.BindException: Address already in use: bind
解决方法:
1.windows+R cmd 打开窗口,输入 netstat -ano。因为Dubbo的端口号是20880,查看它对应的PID是多少。我的是964,每个人都不一样
2.任务管理器查看进程,(PID如果没有的话可以点名称那一栏右键就会出现了,选中就可以了)
结束任务,再次运行。ok了。