wood burning stoves 2.0*
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

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Rest Server Returns HTTP 405 Error" Watch "Rest Server Returns HTTP 405 Error" New topic

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?


Service Class:

Environment: Windows 7, JBoss 5.1, Java 1.6, Eclipse Helios Release 2.
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
Similar Threads
DBUnit, why insert test data, only to delete/re-create tables after?
getting error when deploying web app in weblogic 10.0
how to set domain namin on jboss as 4.0.5
Cant Run Simple Jersey REST Webservice Example