This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RESTFul throws 404 Resource Not Found

 
Maya sekar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • 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.
 
Madhavi Subramaniam
Ranch Hand
Posts: 33
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic