title: Content type 'null' not supported returned by Spring RESTTemplate getForObject method
body: <p>I have a simple REST method in a Spring MVC controller as follows which has a signature of:</p>
  
  <blockquote>
    <p>@RequestMapping(value="/person/{personId}", method=RequestMethod.GET)
        public @ResponseBody Object getPerson(@PathVariable("personId") String personId) {<br>
        ...
       }</p>
  </blockquote>
  
  <p>The output is type <code>Object</code> because several different data types are returned from this method.</p>
  
  <p>When called from a test program within the Spring MVC application, as follows: </p>
  
  <pre><code>private static void getPerson() {
      logger.info(Rest.class.getName() + ".getPerson() method called."); 
  
      RestTemplate restTemplate = new RestTemplate();
  
      Person person = restTemplate.getForObject("http://localhost:8080/Library/rest/person/1", Person.class);   
  
      ObjectMapper responseMapper = new ObjectMapper(); 
      ...
      }
  </code></pre>
  
  <p>The response is <code>Content type 'null' not supported</code> and the call fails. </p>
  
  <p>Can anyone advise why?</p>
  
  <p>When called from a test program in another application which doesn't use Spring but which makes HTTP GET requests, the controller method is called properly and works.</p>