0

I just gave a try at first Server tutorial from http://wiki.restlet.org/docs_2.0/13-restlet/21-restlet/318-restlet/319-restlet.html and here is the source

public class FirstServerResource extends ServerResource {   

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

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

}   

and its throwing out me error,

WARNING: No available server connector supports the required protocols: 'HTTP' . Please add the JAR of a matching connector to your classpath.

I am using Eclipse SDK with GWT and i did had the org.restlet.jar for GWT AND GAE. and also i have configured the WEB.xml as

 <servlet> 
    <servlet-name>RestletServlet</servlet-name> 
    <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class> 
    <init-param> 
        <param-name>org.restlet.application</param-name> 
        <param-value>com.final2.server.FirstServerResource</param-value> 
    </init-param> 
      <init-param> 
        <param-name>org.restlet.clients</param-name> 
        <param-value>HTTP HTTPS</param-value> 
    </init-param> 

</servlet> 

When i run the application FirstServerResource,the server instance must be created and i must be able to locate it at localhost:8182 ,but it does not happens and i get the above error(No available server connector)

Any help regarding this please? I am hitting it hard for few days with this :( !

Rangesh
  • 728
  • 2
  • 12
  • 27
  • I am having the same problem at the moment. Did you solve this. It looks to me like the gae edition of restlet doesn't include the server connector protocols. – nwaltham Jan 13 '13 at 14:42

1 Answers1

0

From what you have posted, I can see the "server side" - the resource that you have provided. But I don't see the client code that tries to access this server side resource. In addition, I don't see the routing rules that tell the client application what url will deliver your test resource.

For specific code samples, it is probably very relevant as to which edition of Restlet you are using (GAE, Android, etc.) but I think that the following documentation may be of use: http://www.restlet.org/documentation/2.0/firstResource [Doc1]

Following the structure of [Doc1] (admittedly a longer example), you have implemented the resource (handled in sections 3, 4, and 5 of [Doc1]). But what is missing is the Application (section 2 of [Doc1]) that will create the routing rules and the Client (section 7 of [Doc1]) that will hit your URL, use the routing rules, and deliver your resource.

Or, perhaps it is all much simpler and you also need to include the org.restlet.ext.net.jar file :). (But [Doc1] is probably still a good reference if you haven't yet read it - why it is a little challenging to find is a bit of a mystery to me). Also, there is the "Restlet in Action" book that is about to come out - and available as an early release download through Manning (http://www.manning.com/louvel/)

user229044
  • 232,980
  • 40
  • 330
  • 338
Richard Berger
  • 247
  • 2
  • 11