Restlet Server无法解析

时间:2011-10-15 13:09:15

标签: rest restlet

我试图设置一个简单的Restlet服务器。我正在阅读Restlet网站上的教程。我已将“org.restlet.jar”文件绑定到我的类路径并尝试运行此代码:

 import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;


public class data_server extends ServerResource {

    public static void main(String[] args) throws Exception {  
        // Create the HTTP server and listen on port 8182  
        new Server(Protocol.HTTP, 8182, data_server.class).start();  
    }  

    @Get  
    public String toString() {  
        return "hello, world";  
    }  

}

然后Eclipse向我显示以下错误:

Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
    Server cannot be resolved to a type
    Server cannot be resolved to a type
    Protocol cannot be resolved to a variable
    Part03 cannot be resolved to a type

    at data_server.main(data_server.java:9)

有人能帮助我吗?

0 个答案:

没有答案