dubbo NullPointerException when address already in use

olhwl3o2  于 2022-10-23  发布在  其他
关注(0)|答案(2)|浏览(296)
  • [Y ] I have searched the issues of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 3.1.1
  • Operating System version: Windows 10
  • Java version: 1.8

Steps to reproduce this issue

  1. Run a Dubbo provider with port 20880
  2. Run another Dubbo provider with port 20880
  3. The second one faild to start

Expected Behavior

Show "Address already in use: bind" or similar message in log

Actual Behavior

Show "java.lang.NullPointerException: null" in log

If there is an exception, please attach the exception trace:

java.lang.NullPointerException: null
	at org.apache.dubbo.remoting.transport.netty4.NettyPortUnificationServer.getLocalAddress(NettyPortUnificationServer.java:221)
	at org.apache.dubbo.remoting.transport.AbstractServer.<init>(AbstractServer.java:75)
	at org.apache.dubbo.remoting.api.pu.AbstractPortUnificationServer.<init>(AbstractPortUnificationServer.java:46)
	at org.apache.dubbo.remoting.transport.netty4.NettyPortUnificationServer.<init>(NettyPortUnificationServer.java:82)
	at org.apache.dubbo.remoting.transport.netty4.NettyPortUnificationTransporter.bind(NettyPortUnificationTransporter.java:32)
	at org.apache.dubbo.remoting.api.pu.PortUnificationTransporter$Adaptive.bind(PortUnificationTransporter$Adaptive.java)
	at org.apache.dubbo.remoting.exchange.PortUnificationExchanger.lambda$bind$0(PortUnificationExchanger.java:41)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)

txu3uszq

txu3uszq1#

I got it, an exception is thrown when the bind method is invoked, and the channel has not been assigned at this time

6qftjkof

6qftjkof2#

I fixed it and raised a PR #10785

相关问题