title: Sprint Rest Content type 'application/json;charset=UTF-8' not supported
body: <p>Calling a Controller from a Java service I have this issue</p>
  
  <blockquote>
    <p>org.springframework.web.HttpMediaTypeNotSupportedException: Content
    type 'application/json;charset=UTF-8' not supported</p>
  </blockquote>
  
  <p>I do not understand what's wrong with my Java code </p>
  
  <pre><code>String url3 = "http://localhost:8889/galian/S/S/S/claimsWS/getContract1";
  ContractDto contractDto = new ContractDto("Test", "20161111", "idTest");
  RestTemplate restTemplate3 = null;
  try {
      restTemplate3 = getRestTemplate(new URI(url3));
  }
  catch (URISyntaxException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
  }
  HttpHeaders headers = new HttpHeaders();
  //headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
  headers.setContentType(MediaType.APPLICATION_JSON);
  HttpEntity&lt;ContractDto&gt; requestEntity = new HttpEntity&lt;ContractDto&gt;(contractDto, headers);
  restTemplate.getMessageConverters().add(new MappingJackson2HttpMessageConverter());
  Object responseEntity = restTemplate3.postForObject(url3, requestEntity, Object.class);
  Map&lt;String, Object&gt; responseObject3 = restTemplate.postForObject(url3, contractDto, Map.class);
  </code></pre>
  
  <p>DTO</p>
  
  <pre><code>public class ContractDto implements Serializable {
      private static final long serialVersionUID = -7597862463769066562L;
  
      protected String contractId;
      protected String claimDate;
      protected String insuredObjectIdentifier;
  
      public ContractDto() {
      }
  
      public ContractDto(String contractId, String claimDate, String insuredObjectIdentifier) {
          this.contractId = contractId;
          this.claimDate = claimDate;
          this.insuredObjectIdentifier = insuredObjectIdentifier;
      }
  
      public String getContractId() {
          return contractId;
      }
  
      public void setContractId(String contractId) {
          this.contractId = contractId;
      }
  
      public String getClaimDate() {
          return claimDate;
      }
  
      public void setClaimDate(String claimDate) {
          this.claimDate = claimDate;
      }
  
      public String getInsuredObjectIdentifier() {
          return insuredObjectIdentifier;
      }
  
      public void setInsuredObjectIdentifier(String insuredObjectIdentifier) {
          this.insuredObjectIdentifier = insuredObjectIdentifier;
      }
  
  }
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>@Controller
  @Lazy
  @RequestMapping("/claimsWS")
  @Transactional
  public class ClaimsController {
  ...
   @RequestMapping(value = "/getContract1", method = RequestMethod.POST)
      public void getContract1(@RequestBody ClaimContractCriteriaDto contractCriteriaDto, HttpServletResponse response) throws IOException {
          ....
          writeResult(response, contratBean);
      }
  </code></pre>