javaeclipsecoapcalifornium

CoAP server could not be started


when I run HelloWorldServer.java of californium(examples), I got this error. How do I fix this? I run this in eclipse..

Mar 08, 2016 8:30:01 PM org.eclipse.californium.core.network.config.NetworkConfig createStandardWithFile
INFO: Loading standard properties from file Californium.properties
Mar 08, 2016 8:30:01 PM org.eclipse.californium.core.CoapServer start
INFO: Starting server
Mar 08, 2016 8:30:01 PM org.eclipse.californium.core.network.CoapEndpoint start
INFO: Starting endpoint at /127.0.0.1:5683
Mar 08, 2016 8:30:01 PM org.eclipse.californium.core.network.CoapEndpoint stop
INFO: Stopping endpoint at address /127.0.0.1:5683
Mar 08, 2016 8:30:01 PM org.eclipse.californium.core.CoapServer start
SEVERE: Address already in use: Cannot bind at /127.0.0.1:5683
Mar 08, 2016 8:30:01 PM org.eclipse.californium.core.network.CoapEndpoint start
INFO: Starting endpoint at /0:0:0:0:0:0:0:1:5683
Mar 08, 2016 8:30:01 PM org.eclipse.californium.core.network.CoapEndpoint stop
INFO: Stopping endpoint at address /0:0:0:0:0:0:0:1:5683
Mar 08, 2016 8:30:01 PM org.eclipse.californium.core.CoapServer start
SEVERE: Address already in use: Cannot bind at /0:0:0:0:0:0:0:1:5683
Mar 08, 2016 8:30:01 PM org.eclipse.californium.core.network.CoapEndpoint start
INFO: Starting endpoint at /192.168.1.102:5683
Mar 08, 2016 8:30:01 PM org.eclipse.californium.core.network.CoapEndpoint stop
INFO: Stopping endpoint at address /192.168.1.102:5683
Mar 08, 2016 8:30:01 PM org.eclipse.californium.core.CoapServer start
SEVERE: Address already in use: Cannot bind at /192.168.1.102:5683
Exception in thread "main" java.lang.IllegalStateException: None of the server endpoints could be started
at org.eclipse.californium.core.CoapServer.start(CoapServer.java:202)
at org.eclipse.californium.examples.HelloWorldServer.main(HelloWorldServer.java:46)

Solution

  • You probably have a previously launch version of the example still running, so it's already using UDP port 5683. Try to kill it using the Console view or from the Debug view in the Debug perspective.