apache / incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.
https://seata.apache.org/
Apache License 2.0
25.19k stars 8.75k forks source link

The server Module ServerTest failed, it occur "hostname can't be null" errors #743

Closed codewaltz1994 closed 5 years ago

codewaltz1994 commented 5 years ago

Ⅰ. Issue Description

I downloads the newest source code, get the dependencies, open the server module run the ServerTest.java , it has errors. After traceing the errors, I found the code execute on this line " RegistryFactory.getInstance().register(new InetSocketAddress(XID.getIpAddress(), XID.getPort()));" in AbstractRpcRemotingServer.java file, the error just happend. It seem that XID have no values, so the XID.getIpAddress()'s call return null, then CHECKHOST method catch that and throw the exception. SO I want to know is there something wrong or I have some mistakes.

Ⅱ. Describe what happened

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

Just paste your stack trace here!

2019-04-08 14:53:21.436 INFO [main]c.a.fescar.core.rpc.netty.AbstractRpcRemotingServer.start:153 -Server started ... Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalArgumentException: hostname can't be null at com.alibaba.fescar.core.rpc.netty.AbstractRpcRemotingServer.start(AbstractRpcRemotingServer.java:158) at com.alibaba.fescar.core.rpc.netty.RpcServer.init(RpcServer.java:131) at ServerTest.main(ServerTest.java:46) Caused by: java.lang.IllegalArgumentException: hostname can't be null at java.net.InetSocketAddress.checkHost(InetSocketAddress.java:149) at java.net.InetSocketAddress.(InetSocketAddress.java:216) at com.alibaba.fescar.core.rpc.netty.AbstractRpcRemotingServer.start(AbstractRpcRemotingServer.java:154) ... 2 more 2019-04-08 14:53:21.452 INFO [ShutdownHook]com.alibaba.fescar.core.rpc.netty.RpcServer.destroy:177 -destroyed rpcServer

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. just downloads the newest source code
  2. get the dependencies ready
  3. open the server module, run the ServerTest.java in test directory , then you will see the exception

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

slievrly commented 5 years ago

@slievrly mark