我试图使用来自CoAP的http://mvnrepository.com/artifact/org.eclipse.californium/californium-core/1.0.1库来安装http://mvnrepository.com/artifact/org.eclipse.californium/californium-core/1.0.1服务器
public class HelloWorldServer extends CoapServer {
private static final int COAP_PORT = 5683;
/*
* Application entry point.
*/
public static void main(String[] args) {
try {
// create server
HelloWorldServer server = new HelloWorldServer();
// add endpoints on all IP addresses
server.addEndpoint(new CoAPEndpoint(new InetSocketAddress("127.0.0.1", COAP_PORT)));
server.start();
} catch (SocketException e) {
System.err.println("Failed to initialize server: " + e.getMessage());
}
}将端点添加到服务器,导致以下异常:
线程"main“中的异常: org/eclipse/californium/elements/RawDataChannel at com.landisgyr.chardonnay.HelloWorldServer.main(HelloWorldServer.java:35)引起: java.lang.ClassNotFoundException: org.eclipse.californium.elements.RawDataChannel at java.net.URLClassLoader.findClass(未知源) at java.lang.ClassLoader.loadClass(未知源) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(未知源).
是否有人使用CoAP服务器使用加利福尼亚Java库?
发布于 2016-02-17 14:34:58
您需要将元件-连接器导入到您的Eclipse项目中。
发布于 2016-01-27 16:44:07
看起来这个项目的某些部分缺失了。
下面是一个逐步运行CoAP HelloWorldServer的教程。
Requirements:Eclipse (+ Egit & Maven集成扩展)、Git、Maven
sudo git clone https://github.com/eclipse/californium.core.git
sudo mvn clean install端点启动和工作
https://stackoverflow.com/questions/34987383
复制相似问题