title: RestTemplate getForObject with Could not read JSON: Unexpected character ('<' (code 60))
body: <p>I want read String from http response,just like this.
  I am trying to do this [see below], and it is throwing error.</p>
  
  <p>1.Client</p>
  
  <pre><code>String string=getForObject("http://127.0.0.1:6060/dc-server/rest/dataset/Book/meta", String.class);
  </code></pre>
  
  <p>2.Server</p>
  
  <pre><code>@ResponseBody
  @RequestMapping(value="/dataset/{datasetName}/meta", method=RequestMethod.GET)
  public String getDatasetMeta(@PathVariable("datasetName") String datasetName) {
      return service.getDatasetMeta(datasetName);
  }
  </code></pre>
  
  <p>spring mvc configure file</p>
  
  <pre><code>&lt;bean id="jsonMessageConverter"
  class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"&gt;
  &lt;/bean&gt;
  &lt;bean id="stringHttpMessageConverter"  class="org.springframework.http.converter.StringHttpMessageConverter"/&gt;
  &lt;bean id="restTemplate" class="org.springframework.web.client.RestTemplate"&gt;
      &lt;property name="messageConverters"&gt;
          &lt;list&gt;
              &lt;ref bean="jsonMessageConverter" /&gt;
              &lt;ref bean="stringHttpMessageConverter"/&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Exception</p>
  
  <pre><code>    org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Unexpected character ('&lt;' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
   at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@19a6fa1; line: 1, column: 2]; nested exception is org.codehaus.jackson.JsonParseException: Unexpected character ('&lt;' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
   at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@19a6fa1; line: 1, column: 2]
      at org.springframework.http.converter.json.MappingJacksonHttpMessageConverter.readInternal(MappingJacksonHttpMessageConverter.java:127)
      at org.springframework.http.converter.AbstractHttpMessageConverter.read(AbstractHttpMessageConverter.java:153)
      at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:81)
      at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:446)
      at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:401)
      at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:199)
      at com.cgs.dc.client.rest.RestConnector.getDatasetMeta(RestConnector.java:55)
      at server/rest/dataset/Book/meta" resulted in 200 (OK)
  14:01:05,395 DEBUG RestTemplate:78 - Reading [java.lang.String] as "application/json" using [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter@1371ddd]
  </code></pre>
  
  <p>Response body</p>
  
  <pre><code>&lt;dataset xmlns="http://sucsoft.com/DC_DEF" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ......
  </code></pre>