-
1. Re: JBoss AS 5.1.0 REST support (PUT, DELETE)?
vaedama Nov 11, 2011 3:49 PM (in response to fihtisham)Hello Farrukh,
Just a cross-check: If you are using Jersey implementation of JAX-RS, verify if u have the following jars in the lib directory under web-inf folder?
1. asm
2. dom4j
3. jackson-core-asl
4. jersey-client
5. jersey-core
6. jersey-json
7. jersey-server
8. jettison
9. jsr311
Suggestion: I don't use PUT, POST, DELETE at all. I do all the operations using GET method only. That makes my coding more easy. Try changing that if it is possible.
Coming to the problem, this is not JBoss AS settings problem. It seems that you don't have resources on the requested URI. Make sure that the resources are available.
If your URI is pointing to a particular resource (say a database object, first go and check if it exists). DELETE operation on unavailable resource gives that 405 error.
Also make sure that your database connection is NOT closed while you are calling those methods (PUT and DELETE). (You can Log the sql connection in the methods where you have your PUT and DELETE methods.)
-
2. Re: JBoss AS 5.1.0 REST support (PUT, DELETE)?
mp911de Nov 13, 2011 11:42 PM (in response to fihtisham)Hi Farrukh,
this message you get is created by your stack or let me explain it on a example:
You can create a plain HttpServlet which has doPost() and doGet()-methods. Calling a POST or a GET would call these methods. When you would call DELETE or PUT it would result in the same message as you mentioned. The same applies to RESTful resources. When you have a resource annotated with @GET and an other method with @POST so GET and POST calls will go though, but only these.
So you should check your REST impl, because there lies the solution. If you like, just post some code, perhaps i could help.
@Venkat: Just changing the impl to use GET for updating REST resouces is not the right way.
Best regards,
Mark
-
3. Re: JBoss AS 5.1.0 REST support (PUT, DELETE)?
vaedama Nov 14, 2011 5:27 PM (in response to mp911de)Hello Mark,
You are right. That wasn't a solution. It was just a "suggestion". It always made my coding easy. May be it's my perspective. Thanks for your ideas.
Farrukh,
If you are facing the same issue post your code snippets if you think it is okay. I suggest you to check the availability of the resources on those URIs once again.
-Sudheer.