*
The moose likes Web Services and the fly likes Rest Server Returns HTTP 405 Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Rest Server Returns HTTP 405 Error" Watch "Rest Server Returns HTTP 405 Error" New topic
Author

Rest Server Returns HTTP 405 Error

Shannon Sims
Ranch Hand

Joined: Jul 03, 2003
Posts: 197
Hello all and thanks for reading my post!

I’m trying to get my client communicating with the Rest server. I found this link: http://www.theserverside.com/tip/RESTful-Web-services-made-easy.
When I try to invoke a simple service using the example code, I get “HTTP Status 405 - specified HTTP method is not allowed for the requested
resource ()”. The web.xml in the example shows a servlet mapping to a Jersey ServletContainer. I’m not using Jersey; is there a different
ServletContainer I should use instead? If I do, will this conflict with the HttpServletDispatcher?

Web.xml


Service Class:


Environment: Windows 7, JBoss 5.1, Java 1.6, Eclipse Helios Release 2.
Thanks!
Shannon Sims
Ranch Hand

Joined: Jul 03, 2003
Posts: 197
Figured out my issue:

You need to set the “resteasy.servlet.mapping.prefix” if your servlet-mapping for the resteasy servlet has a url-pattern other than “/*“.

The resteasy servlet url-pattern is “/rest/*“, so you have to set the “resteasy.servlet.mapping.prefix” to “/rest” as well, otherwise, you will hit resource not found error message.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Rest Server Returns HTTP 405 Error