aspose file tools*
The moose likes Web Services and the fly likes RESTFul throws 404 Resource Not Found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "RESTFul throws 404 Resource Not Found " Watch "RESTFul throws 404 Resource Not Found " New topic
Author

RESTFul throws 404 Resource Not Found

Maya sekar
Ranch Hand

Joined: Sep 22, 2011
Posts: 70
Hi Everybody ,

I wrote a simple Rest Service, using Jersey Jar and ran the same in Apache Tomcat 6 Server,



It throws Resource Not Found Error. I access it using the url http://localhost:9090/Test2/hello (9090 is the port my tomcat is running. Not 8080. Test2 is the project name in eclipse. ) Can anybody please tell me why?

thank you. Have a nice day.
Madhavi Subramaniam
Ranch Hand

Joined: Nov 24, 2011
Posts: 33
Hi Maya,

Have tried like this

@Path("/hello")
public class Testing {

@GET
@Path("sample")
@Produces(MediaType.TEXT_PLAIN)
public String test()
{
return "hello";
}

}

URL is http://localhost:9090/Test2/hello/sample

We've to set path for method also not only class.

I hope you have done proper configuration changes for Rest service in web.xml

Thanks
Maya sekar
Ranch Hand

Joined: Sep 22, 2011
Posts: 70
Thank you for your quick response. But turns out I did not make the configuration changes in the web.xml that you mentioned. I have resolved it now...

Thanks again for your response.
have a nice day
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RESTFul throws 404 Resource Not Found