title: Jersey failed with request header application/xml
body: <p>I'm new to jersey. I've a test rest for return a Map. </p>
  
  <pre><code>    @GET
      @Path("/maptest")
      @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
      public Map&lt;String, TestObject&gt; mapTest()
              throws JdException {
          // return a non-empty HashMap contains String-TestObject
      }
  
  }
  </code></pre>
  
  <p>It works fine if request head is set to <em>/</em> or application/json. But failed with exception if request head is application/xml:</p>
  
  <pre><code>Caused by: com.sun.jersey.api.MessageException: A message body writer for Java class java.util.HashMap, and Java type java.util.Map&lt;java.lang.String, TestObject&gt;, and MIME media type application/xml was not found
      ... 31 more
  </code></pre>
  
  <p>I've added XmlRootElement annotation to TestObject. It works with application/xml if return type is set to <code>List&lt;TestObject&gt;</code>. Can't XML handle Map?</p>