I´m trying to run my first Restlet server with this code:
import org.restlet.Server;
import org.restlet.data.Protocol;
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;
public class WebServer extends ServerResource {
/**
* @param args
* @throws Exception
*/
public WebServer() throws Exception {
// Create the HTTP server and listen on port 8182
Server server = new Server(Protocol.HTTP, 8182, WebServer.class);
server.start();
}
@Get
public String present() {
return "hello, world";
}
}
But when I start the server, I get this error message:
No available server connector supports the required protocols: 'HTTP' . Please add the JAR of a matching connector to your classpath. Then, register this connector helper manually.
I copied the "org.restlet.jar" to the \libs folder and add JAR to the Libraries in Java Build Path. What should I do? What is wrong?