com.sun.jersey.api.client.UniformInterfaceException: GET http://localhost:8080/filter/1000/config/ returned a response status of 405 Method Not Allowed

Java.net JIRA | jesmith17 | 5 years ago
  1. 0

    I have a WS class using Jersey annotations. 2 different methods that are both bound to the same URL patter /filter/{channel_id}/ip One uses a GET, the other a POST. Regardless of which method I call, I get back a 405 response. Exception in thread "main" com.sun.jersey.api.client.UniformInterfaceException: GET http://localhost:8080/filter/1000/config/ returned a response status of 405 Method Not Allowed at com.sun.jersey.api.client.WebResource.handle(WebResource.java:676) at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74) at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:503) I tried switching the POST to a PUT (as according to some information the POST is a hybrid of GET and PUT in terms of how jersey supports it). I have found examples from Jersey that shows that I should be able to do this. In fact, it's a pretty fundamental part of REST services. Any ideas here is code examples to show you what all is happening --- Example of the GET {code}@GET @Path("/{channelId}/ip/") @Produces(MediaType.APPLICATION_JSON) public List<IPBlackList> getAllForChannel( @HeaderParam("authToken") String authToken, @PathParam("channelId") Integer channelId){ ac.checkAccess(authToken,uriInfo.getPath()); return blackListService.getIPBlackListByChannel(channelId); } {code} ----- POST Example {code}@POST @Consumes(MediaType.APPLICATION_JSON) @Path("/{channelId}/ip/") public void saveIPBlackList(@HeaderParam("authToken") String authToken, @PathParam("channelId") Integer channelId, List<IPBlackList> ipBlackLists){ ac.checkAccess(authToken,uriInfo.getPath()); for (IPBlackList ip : ipBlackLists){ ip.setChannelId(channelId); } blackListService.saveIPBlackList(ipBlackLists); }{code}

    Java.net JIRA | 5 years ago | jesmith17
    com.sun.jersey.api.client.UniformInterfaceException: GET http://localhost:8080/filter/1000/config/ returned a response status of 405 Method Not Allowed
  2. 0

    REST + Java + Status 500 Internal Error

    Stack Overflow | 5 years ago | twain249
    com.sun.jersey.api.client.UniformInterfaceException: GET http://localhost:8080/TigrisRESTServer/rest/media?type=music returned a response status of 500 Internal Server Error
  3. 0

    REST Service Error

    Google Groups | 5 years ago | Jerry Higgs
    com.sun.jersey.api.client.UniformInterfaceException: GET http://localhost/de.vogella.jersey.third/rest/hello returned a response status of 404 Not Found
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Jersey - Application/json for JAXB class failed in 1.10

    nabble.com | 12 months ago
    com.sun.jersey.api.client.UniformInterfaceException: GEThttp://192.168.56.101:7474/examples/unmanaged/todo returned a response status of 500 Internal Server Error
  6. 0

    java swingとtwitter4jについて

    Google Groups | 4 years ago | 鈴木
    com.sun.jersey.api.client.UniformInterfaceException: GET http://twitter.com/statuses/user_timeline.xml?count=1 returned a response status of 404 Not Found

    3 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.sun.jersey.api.client.UniformInterfaceException

      GET http://localhost:8080/filter/1000/config/ returned a response status of 405 Method Not Allowed

      at com.sun.jersey.api.client.WebResource.handle()
    2. jersey-client
      WebResource$Builder.get
      1. com.sun.jersey.api.client.WebResource.handle(WebResource.java:676)
      2. com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
      3. com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:503)
      3 frames