Spring Controller unable to return JSON

nparaboma

New Member
I have a spring controller with multiple methods each of which return data in XML or JSON based on the headers. All the methods return the data successfully except one method which has an issue in returning JSON data. All I see is "500 Internal Server Error" in the logsThis is how my method looks like:\[code\]@RequestMapping (value="http://stackoverflow.com/test", method=RequestMethod.GET, headers ={"Accept=text/xml, application/json"})public @ResponseBody MyObject getMyObject() throws FileNotFoundException, JAXBException { return getMyService().getMyObject();} \[/code\]Eclipse console doesn't show any error, Tomcat logs only display the "500 Internal Server Error" and if I debug then getMyService().getMyObject() has the correct data. So what is the cause for the 500 error? and why is it working fine for XML requests but not for JSON? Thanks!
 
Back
Top