title: Could not write JSON: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer
body: <p>I am trying to do and https post to an site using spring rest template(It accepts post, but  doesn't accept JSON) with Spring MultiPart file upload.</p>
  
  <p>Following error was received, when doing so,</p>
  
  <blockquote>
    <p>org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer.</p>
  </blockquote>
  
  <pre><code>MultiValueMap&lt;String, Object&gt; formData = new LinkedMultiValueMap&lt;String, Object&gt;();
  formData.add("NUMBER", "ABC");
  formData.add("ID", "123");
  formData.add("FILE",file); // this is spring multipart file
  HttpHeaders headers = new HttpHeaders();
  headers.set("Content-Type", "multipart/form-data"); 
  headers.set("Accept", "text/plain"); 
  HttpEntity&lt;MultiValueMap&lt;String, Object&gt;&gt; requestEntity = new HttpEntity&lt;MultiValueMap&lt;String, Object&gt;&gt;(formData, headers);
  RestTemplate restTemplate = getRestTemplate();
  
  String result  = restTemplate.postForObject(uploadUri, requestEntity, String.class);
  </code></pre>