0

I noticed this glassfish error that is due to the REST methods where I return an object with which I produce json:

@GET
@Path("/myUrl")
@Produces("application/json")
MyObject getObject(@Context UriInfo info){
...
return new MyObject(...);
}

how to resolve this problem ?

Youcef LAIDANI
  • 55,661
  • 15
  • 90
  • 140
James13Y
  • 41
  • 4
  • 1
    Check your log files. – Andreas Dec 26 '16 at 15:00
  • Check whether your `MyObject` is being initialized with `@XmlRootElement`. Your response object is not getting mapped properly with your entity. – CodeRunner Dec 26 '16 at 17:08
  • With @XmlRootElement is the same problem. I use com.sun.jersey (servlet, json ...). Now I return a string and use gson to convert my object in a string, it's working – James13Y Dec 28 '16 at 13:48

0 Answers0