Reputation: 6817
Got these error while trying to run my first Java webservice tutorial in Eclipse. What does it means :(
SayHello Web Service started.
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(Unknown Source)
at com.sun.xml.internal.ws.transport.http.server.HttpEndpoint.publish(Unknown Source)
at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(Unknown Source)
at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(Unknown Source)
at javax.xml.ws.Endpoint.publish(Unknown Source)
at com.myfirst.wsServer.RunService.main(RunService.java:14)
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
at sun.net.httpserver.ServerImpl.<init>(Unknown Source)
at sun.net.httpserver.HttpServerImpl.<init>(Unknown Source)
at sun.net.httpserver.DefaultHttpServerProvider.createHttpServer(Unknown Source)
at com.sun.net.httpserver.HttpServer.create(Unknown Source)
... 6 more
Upvotes: 3
Views: 10843
Reputation: 2514
It simply means your address (usually it is the port number,xxxx) is already in used by other application . Try change your port number for the end point publisher.
public static void main(String[] args) {
Endpoint.publish("http://localhost:1234/ws/hello", new WallStreetImpl());
}
Source: Java.Net.BindException: Address Already In Use: Bind
Upvotes: 0
Reputation: 3984
It means you're trying to start the container listening on a port that's already occupied by another instance. You can try running netstat
to find out the process ID (PID) and kill it.
Upvotes: 2
Reputation: 7779
This means you already have a process bound to the port number. Stop any process that is listening to that port and you'd be good to go. Its possible that the server has already started, and you should be able to see its output as a console on Eclipse. If you see that, click the big red square to stop it. If you started the server outside of Eclipse, locate it by using netstat | grep 'port number'
and then kill it.
Upvotes: 5