java cxf 搭soa,WebService CXF入门问题 SOA 骑着上帝去环游 - 贪吃蛇学院-专业IT技术平台...
package deng;
import javax.xml.ws.Endpoint;
import com.founder.ws.HelloWorld;
import com.founder.ws.impl.HelloWorldImpl;
/**
*
* @author administrator
* @see 暴露 webservice 给其他应用程序调用
*
*/
public class ServiceMain {
public static void main(String []args) throws Exception{
HelloWorld hello = new HelloWorldImpl();
Endpoint.publish("http://172.18.74.47/crazyWeb", hello);
System.out.println("WebService 暴露成功!");
}
}
本人初学WebService,烦请前辈指导
本人电脑是自动获取IP,然后报如下错误:
Exception in thread "main" com.sun.xml.internal.ws.server.ServerRtException: Server Runtime Error: java.net.BindException: Address already in use: 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:118)
at javax.xml.ws.Endpoint.publish(Endpoint.java:240)
at deng.ServiceMain.main(ServiceMain.java:19)
Caused by: java.net.BindException: Address already in use: 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.(ServerImpl.java:100)
at sun.net.httpserver.HttpServerImpl.(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
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
