web Services中出现的异常解决方法

来源:互联网 发布:私有云软件 编辑:程序博客网 时间:2024/05/16 05:27

异常:

Exception in thread "main" com.sun.xml.internal.ws.server.ServerRtException: Server Runtime Error: java.net.BindException: Cannot assign requested address: bind
at com.sun.xml.internal.ws.transport.http.server.ServerMgr.createContext(ServerMgr.java:102)
at com.sun.xml.internal.ws.transport.http.server.HttpEndpoint.publish(HttpEndpoint.java:63)
at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:171)
at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:113)
at javax.xml.ws.Endpoint.publish(Endpoint.java:240)
at com.webservice.FBWeb.ServerTest.main(ServerTest.java:16)
Caused by: java.net.BindException: Cannot assign requested address: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at sun.net.httpserver.ServerImpl.<init>(ServerImpl.java:100)
at sun.net.httpserver.HttpServerImpl.<init>(HttpServerImpl.java:50)
at sun.net.httpserver.DefaultHttpServerProvider.createHttpServer(DefaultHttpServerProvider.java:35)
at com.sun.net.httpserver.HttpServer.create(HttpServer.java:129)
at com.sun.xml.internal.ws.transport.http.server.ServerMgr.createContext(ServerMgr.java:84)
... 5 more

服务器运行时错误:java.net.bindexception:不能分配请求的地址:绑

解决方法:  检查下端口是否占用,或者该地址是否已经绑定过一次.或是把绑定的ip设为0.0.0.0

                        再设置一下端口号


0 0