RestEasy - Jax-rs - Sending custom Object in response body
How do I send my custom object in a response. I just want the values printed from my object. Lets say I have an object of type Person . I am trying to send in REST response body like this. ResponseBuilder response = Response.ok().entity(personObj); return response.build(); But I get 500 error. Tried this one too: ResponseBuilder response = Response.status(Status.OK).entity(personObj); return response.build(); Same error. Tried setting content type as text/xml . No use. What am I missing here? I tried googling. But not many examples out there, especially with the custom objects; It returns fine