开发者

My server application doesn't work on eclipse

when I run my server application on eclipse it doesn't work and the error is shown as following:

java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.PlainSocketImpl.bind(Unknown Source)
    at java.net.ServerSocket.bind(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
  开发者_如何转开发  at java.net.ServerSocket.<init>(Unknown Source)
    at MyServer.main(MyServer.java:17)
Exception in thread "main" java.lang.NullPointerException
    at MyServer.main(MyServer.java:26)


I think you forgot to initialize the port and you are trying to connect to port=0 that is invalid. I thing that your application receives port via command line. When you are running it from eclipse you forgot to provide it. Do it using the run/debug configuration.

It is just a theory. I do not see your code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜