Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WARNING: A HTTP GET method, public javax.ws.rs.core.Response... throws org.codehaus.jettison.json.JSONException, should not consume any entity

I have the following GET method, and it fails to send send back the result to the client.

/*@GET here defines, this method will process HTTP GET requests. */
@GET
@Path("/test/{name}/{status}")
@Produces("application/json")
  public Response Name(@PathParam("name,status") String name, String status ) throws JSONException {
  String total = "100";
  .
  .
  .
  String result = "" + jsonObject;

  return Response.status(200).entity(result).build();
}

When I run it, I have the message below: WARNING: A HTTP GET method, public javax.ws.rs.core.Response... throws org.codehaus.jettison.json.JSONException, should not consume any entity.

Does it have to do with the fact that I have two parameters ?

I already checked online but nothing relevant to my situation. Thanks in advance!

like image 668
Joie Tamayo Avatar asked Aug 09 '14 03:08

Joie Tamayo


1 Answers

I think I have found the issue...it should be like this:

Name(@PathParam("name") String name, @PathParam("status") String status ) 

Thanks!

like image 156
Joie Tamayo Avatar answered Oct 18 '22 18:10

Joie Tamayo