org.springframework.http.InvalidMediaTypeException: Invalid mime type "xml": does not contain '/'

tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Spring RestTemplate throws InvalidMediaTypeException

    Stack Overflow | 7 months ago | Vlad Kudryavtsev
    org.springframework.http.InvalidMediaTypeException: Invalid mime type "xml": does not contain '/'
  2. 0

    Spring: How to avoid InvalidMimeTypeException in WFS request ("text/xml; subtype=gml/2.1.2")

    Stack Overflow | 2 years ago | Hannes Smit
    org.springframework.http.InvalidMediaTypeException: Invalid mime type "text/xml; subtype=gml/2.1.2": Invalid token character '/' in token "gml/2.1.2"

    Root Cause Analysis

    1. org.springframework.http.InvalidMediaTypeException

      Invalid mime type "xml": does not contain '/'

      at org.springframework.http.MediaType.parseMediaType()
    2. Spring
      RestTemplate.postForEntity
      1. org.springframework.http.MediaType.parseMediaType(MediaType.java:385)
      2. org.springframework.http.HttpHeaders.getContentType(HttpHeaders.java:722)
      3. org.springframework.web.client.HttpMessageConverterExtractor.getContentType(HttpMessageConverterExtractor.java:114)
      4. org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:85)
      5. org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:835)
      6. org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:819)
      7. org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:599)
      8. org.springframework.web.client.RestTemplate.execute(RestTemplate.java:557)
      9. org.springframework.web.client.RestTemplate.postForEntity(RestTemplate.java:384)
      9 frames