Dropwizard/Jersey is giving "Unable to process JSON" message on GET request Dropwizard/Jersey is giving "Unable to process JSON" message on GET request json json

Dropwizard/Jersey is giving "Unable to process JSON" message on GET request


Looks like your json marshaller is not able to marshall google's Optional class. Try to return Company from the controller, and not Optional:

@GET@Path("/{id}")@UnitOfWorkpublic Company getById(@PathParam("id") LongParam id) {    return companyDAO.findById(id.get()).get();}


I was getting the error Unable to Process JSON.Troubleshooted more than 4 hours until I found the problem.

The error is caused because of Enum getter.

If you are using Enum fields/getters/setters in your POJO, Jackson will fail to map your JSON to Java Object, and it will crash, leading to the mentioned error.