• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Rest Server Returns HTTP 405 Error

 
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Wink, wink, nudge, nudge, say no more, it's a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic