title: Unsupported Media Type (415) Error while implementing File upload using Jersey in Mule
body: <p>I am trying to implement File Upload using Jersey module in Mule. </p>
  
  <p>My mule flow looks like this:</p>
  
  <pre><code>&lt;flow name="rest-service"&gt;
      &lt;inbound-endpoint address="http://localhost:9999/testupload"/&gt;
      &lt;jersey:resources&gt;
          &lt;component class="com.example.test.UploadFileResource"/&gt;
      &lt;/jersey:resources&gt;
  &lt;/flow&gt; 
  </code></pre>
  
  <p>If I don't put @Consumes annotation in the resource method in UploadFileResource like below, the method gets called when an HTTP Post request is made using multipart/form-data  Content-type and I get HTTP 2xx status code:</p>
  
  <pre><code>@Path("/uploadfile")
  public class UploadFileResource {
  
      @POST
      public Response uploadFile2(...) {
          logger.info("Multipart Upload");
          ...
      }
  }
  </code></pre>
  
  <p>But when I put @Consumes annotation with MULTIPART_FORM_DATA Media Type like below, the method does not get called and I get HTTP 415 Unsupported Media type, even when the HTTP Post request is made using multipart/form-data Content-type:</p>
  
  <pre><code>@Path("/uploadfile")
  public class UploadFileResource {
  
      @POST
      @Consumes(MediaType.MULTIPART_FORM_DATA)
      public Response uploadFile2(...) {
          logger.info("Multipart Upload");
          ...
      }
  }
  </code></pre>
  
  <p>Any idea why 415 status comes even when @Consumes Media type matches the HTTP Post Content-type header?</p>