title: Spring Controller unable to return JSON
body: <p>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 <strong>has an issue in returning JSON data</strong>. All I see is "500 Internal Server Error" in the logs</p>
  
  <p>This is how my method looks like:</p>
  
  <pre><code>@RequestMapping (value="/test", method=RequestMethod.GET, headers ={"Accept=text/xml, application/json"})
  public @ResponseBody MyObject getMyObject() throws FileNotFoundException, JAXBException {
  
      return getMyService().getMyObject();
  }   
  </code></pre>
  
  <p>Eclipse console doesn't show any error, <strong>Tomcat logs only display the "500 Internal Server Error"</strong> 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!</p>