Search code examples
restlet

Restlet : Requested resource not found


I am new to rest, so I followed this tutorial exactly the way its mentioned here:

However, I get a requested resource not found error when I hit the URI mentioned there, that is, http://localhost:8080/RestletDemo/service/helloWorld

My build was successful.

This is the first time I am posting a question, my apologies for any ambiguity. Do let me know if you need more information.


Solution

  • It's difficult to figure out your problem like that. I have a look at your link and the problem of the provided code is that there are a lot of plumbing. Things could be much more simpler leveraging for example bean converters (Jackson one for example).

    However, I didn't see anything strange in this code. Perhaps it's a configuration problem within your servlet container. For example, when using Tomcat with WTP in Eclipse, I need to check the item "Publish module contexts to separate XML files" to make things work.

    I just submitted a very simple Restlet project targetting servlet and without all these plumbing. I made it work under Eclipse with WTP 2 (Tomcat7). You can reach it here:

    https://github.com/templth/restlet-stackoverflow/tree/master/restlet/test-restlet-servlet

    Since it use Maven, to use it, you can simply :

    • mvn eclipse:eclipse and then import it into Eclipse. You can then create a server (WTP) and add the project
    • mvn package and deploy the corresponding war into a servlet container (Tomcat or something else)

    Hope it helps you, Thierry