We have been using @ResponseBody annotations for the RESTControllers in our application.Our application serves as a layer between mobile Request and an EJB service layer. As we are leveraging a legacy system, we often try to reuse the same DTOs from the EJB side to cast the objects that are given to the mobile in response. We are using @ResponseBody to send the output as JSON.And many a time, we have issues when a DTO has another sub DTO which doesn't have values/improper values which would cause a "406" on a REST request. . We try to debug this by instantiating the Object mapper itself ObjectMapper
I also use RestClient in chrome browser something like Postman. Putting my question in general terms, how could we debug if there is some issue with message converters while using an Annotation like @ResponseBody?. In my case i am using jackson internally in my configuration , so that the Response from the Controller would be of Json format. My configuration has the following for Json conversion which is used by @ResponseBody
So we may need to put back the code (which i pasted in previous post) to see exactly at which point the error is happening while a DTO is coverted into a message. As you said, i have the server in debug mode and would be able to see the point of error.My question is, is there a better way for this debugging.
I've never won anything before. Not even a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop