title: Springboot HttpMessageNotWritableException: No converter for [...] with preset Content-Type 'null']
body: <p>I try create web API with XML and JSON with Springboot 2.2.4.RELEASE + JDK11 and java 8 compilation.</p>
  
  <p><strong>my model:</strong></p>
  
  <pre><code>@XmlRootElement
  public class DataModel {
  
      private List&lt;String&gt; columns;
  
      private List&lt;Row&gt; rows;
  
      public List&lt;String&gt; getColumns() {
          return columns;
      }
  
      public void setColumns(List&lt;String&gt; columns) {
          this.columns = columns;
      }
  
      public List&lt;Row&gt; getRows() {
          return rows;
      }
  
      public void setRows(List&lt;Row&gt; rows) {
          this.rows = rows;
      }
  
  }
  </code></pre>
  
  <p><strong>my controller:</strong></p>
  
  <pre><code>@RequestMapping(value = "/{model}/columns", method = RequestMethod.GET, consumes = MediaType.ALL_VALUE, produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE })
  public ResponseEntity&lt;DataModel&gt; getColumnsModel(@PathVariable String model) {
      LOGGER.info("getColumnsModel : model[{}]", model);
      DataModel dataModel = modelService.getColumns(model);
      return Optional.ofNullable(dataModel).map(result -&gt; new ResponseEntity&lt;&gt;(result, HttpStatus.OK)).orElse(new ResponseEntity&lt;&gt;(HttpStatus.NO_CONTENT));
  }
  </code></pre>
  
  <p>I use a curl:</p>
  
  <pre><code>curl -s -v --header "Accept: application/xml" http://localhost:8084/api/foo/columns
  </code></pre>
  
  <p>On my computer (windows 10) the result is OK.</p>
  
  <pre><code>* TCP_NODELAY set
  * Connected to localhost (::1) port 8084 (#0)
  &gt; GET /noraui/api/hello/columns HTTP/1.1
  &gt; Host: localhost:8084
  &gt; User-Agent: curl/7.67.0
  &gt; Accept: application/xml
  &gt;
  * Mark bundle as not supporting multiuse
  &lt; HTTP/1.1 200
  &lt; X-Content-Type-Options: nosniff
  &lt; X-XSS-Protection: 1; mode=block
  &lt; Cache-Control: no-cache, no-store, max-age=0, must-revalidate
  &lt; Pragma: no-cache
  &lt; Expires: 0
  &lt; X-Frame-Options: DENY
  &lt; Content-Type: application/xml
  &lt; Transfer-Encoding: chunked
  &lt; Date: Tue, 03 Mar 2020 08:38:20 GMT
  &lt;
  { [254 bytes data]
  * Connection #0 to host localhost left intact
  </code></pre>
  
  <p><strong>My error on Unix plateform (travis-ci):</strong></p>
  
  <pre><code>Resolved [org.springframework.http.converter.HttpMessageNotWritableException: No converter for [class com.github.noraui.data.rest.DataModel] with preset Content-Type 'null']
  
  &lt; HTTP/1.1 500 
  &lt; X-Content-Type-Options: nosniff
  &lt; X-XSS-Protection: 1; mode=block
  &lt; Cache-Control: no-cache, no-store, max-age=0, must-revalidate
  &lt; Pragma: no-cache
  &lt; Expires: 0
  &lt; X-Frame-Options: DENY
  &lt; Content-Length: 0
  &lt; Date: Tue, 03 Mar 2020 08:41:28 GMT
  &lt; Connection: close
  &lt; 
  * Closing connection 0
  </code></pre>