• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

RESTFul throws 404 Resource Not Found

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 33
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You'll never get away with this you overconfident blob! The most you will ever get is this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic