title: Cannot consume content type-RestEasy
body: <p>I develop RestEasy web service(maven/java/tomcat I use for develop the web service) then i got massage <strong>Cannot consume content type</strong> like this. Why I got like this error,</p>
  
  <pre><code>2015-10-19 17:55:02,823 [http-nio-8080-exec-10] WARN  org.jboss.resteasy.core.ExceptionHandler  - failed to execute
  javax.ws.rs.NotSupportedException: Cannot consume content type
      at org.jboss.resteasy.core.registry.SegmentNode.match(SegmentNode.java:380)
      at org.jboss.resteasy.core.registry.SegmentNode.match(SegmentNode.java:114)
      at org.jboss.resteasy.core.registry.RootNode.match(RootNode.java:43)
      at org.jboss.resteasy.core.registry.RootClassNode.match(RootClassNode.java:48)
      at org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:444)
      at org.jboss.resteasy.core.SynchronousDispatcher.getInvoker(SynchronousDispatcher.java:234)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:171)
      at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1526)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1482)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>My java class like this,</p>
  
  <pre><code>@POST
  @Path("/createMime")
  @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
  @Produces({ MediaType.APPLICATION_FORM_URLENCODED })
  public String createMime(CategoryType categoryType) throws MyRestException {
  
          logger.info("Processing /createMime");
          //same code here
          return userDAO.category(categoryType);
      }
  </code></pre>
  
  <p>How I solve that question? below image is my request sent thought <strong>Rest client</strong></p>
  
  <p><a href="https://i.stack.imgur.com/ZnlQc.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ZnlQc.png" alt="enter image description here"></a></p>