java - CoAP 服务器无法启动

标签 java eclipse coap californium

当我运行 californium(examples) 的 HelloWorldServer.java 时,出现此错误。 我该如何解决? 我在 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)

最佳答案

日志本身说明发生的错误是什么

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

为了杀死绑定(bind)到5683的进程

sudo kill -9 $(lsof -t -i:5683) 

关于java - CoAP 服务器无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35871161/

相关文章:

javascript - 使用 Node js 的 COAP API 触发器

node.js - NodeJS 上的 CoAP block 式传输

java - Android 计时器的运行速度能否超过 1 毫秒

java - 在方法中发送一组对象?

java - 如何使 XML 文档无需中间文件存储即可下载?

java - eclipse 在保存项目时自动编译。如何摆脱它

java - 为什么 Eclipse 无缘无故吃掉了几乎所有的 CPU

java - 从里面的类找到一个 jar 的路径?

android - 安装安卓工作室

linux - CoAP数据包的大小是多少?