title: Supperclass in request body - 'application/xml;charset=UTF-8' not supported
body: <p>I want to send to my endpoint an xml object but I will have serveral types of this object and I would like to use inheritance. </p>
  
  <p>My supperclass look like this:</p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.FIELD)
  @XmlSeeAlso(Sgr.class)
  public class AbstractSgr {
  
    @XmlAttribute(required = true)
    protected String id;
  
    @XmlAttribute(required = true)
    protected String field1;
  
    @XmlAttribute(required = true)
    protected String field2;
  
    @XmlElement
    @XmlSchemaType(name = "date")
    protected LocalDate startDate;
  
    @XmlElement
    @XmlSchemaType(name = "date")
    protected LocalDate endDate;
  //getters setters
    }
  </code></pre>
  
  <p>My Child class:</p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.FIELD)
  @XmlRootElement(name = "sgr")
  public class Sgr extends AbstractSgr {
  
    @XmlElementWrapper(name = "competitions")
    @XmlElement(name = "competition")
    private List&lt;String&gt; competitions;
  
    @XmlElementWrapper(name = "games")
    @XmlElement(name = "game")
    private List&lt;String&gt; games;
  //getters setters
    }
  </code></pre>
  
  <p>And my package info:</p>
  
  <pre><code>@XmlJavaTypeAdapters({
      @XmlJavaTypeAdapter(type = java.time.LocalDate.class, value = LocalDateAdapter.class),
  })
  @XmlSchema(namespace = "http", elementFormDefault = XmlNsForm.QUALIFIED)
  </code></pre>
  
  <p>My controller:</p>
  
  <pre><code>@RequestMapping(value = "/test/mapping", method = RequestMethod.POST,
        consumes = MediaType.APPLICATION_XML_VALUE)
    public ResponseEntity&lt;HttpStatus&gt; saveSgr(
        @RequestBody final AbstractSgr sgr) throws ServiceException {
  
        }
  </code></pre>
  
  <p>The problem is when I send the post request with my valid XML I get the following error:</p>
  
  <pre><code>org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/xml;charset=UTF-8' not supported
      at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.readWithMessageConverters(HandlerMethodInvoker.java:645) ~[spring-web-4.0.5.RELEASE.jar:4.0.5.RELEASE]
      at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveRequestBody(HandlerMethodInvoker.java:604) ~[spring-web-4.0.5.RELEASE.jar:4.0.5.RELEASE]
      at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveHandlerArguments(HandlerMethodInvoker.java:353) ~[spring-web-4.0.5.RELEASE.jar:4.0.5.RELEASE]
      at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:170) ~[spring-web-4.0.5.RELEASE.jar:4.0.5.RELEASE]
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:446) ~[spring-webmvc-4.0.5.RELEASE.jar:4.0.5.RELEASE]
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:434) ~[spring-webmvc-4.0.5.RELEASE.jar:4.0.5.RELEASE]
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) [spring-webmvc-4.0.5.RELEASE.jar:4.0.5.RELEASE]
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) [spring-webmvc-4.0.5.RELEASE.jar:4.0.5.RELEASE]
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) [spring-webmvc-4.0.5.RELEASE.jar:4.0.5.RELEASE]
      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863) [spring-webmvc-4.0.5.RELEASE.jar:4.0.5.RELEASE]
  </code></pre>
  
  <p>But when I change the type of sgr object to Sgr everything works fine I get the correct object. Has someone had similar problem?</p>