If we try to return a JsonOject in jersey, like this @Path("/formSubmit") @POST @Produces("application/json") public JSONObject formSubmit() { JSONObject json1 =new ...