title: MIME media type application/xml was not found in command line, but work in Eclipse
body: <p>I am using Maven, Jersey and Jetty server to build a web service interface.</p>
  
  <p>When I developed and tested the software on Eclipse, everything work fine.  However, when I am trying to deploy the project, and make request to the interface, the server reported that "MIME media type application/xml was not found".</p>
  
  <p>I tried a few days to figure the problem and found that the ServiceFinder (provided by Jersey), can find all MessageBodyWriter on Eclipse, but not in command line.  I also checked that all jersery libs are already in place, and defined inside the META-INF.</p>
  
  <p>Any help is highly appreciated!  Thanks!</p>
  
  <p>JDK: 1.6.0_30
  Eclipse: Indigo SR2
  Jersey: 1.12
  Jetty: 6.1.25</p>
  
  <p>ServiceFinder Code: </p>
  
  <pre><code>ServiceFinder.find(javax.ws.rs.ext.MessageBodyWriter.class, true).toClassArray();
  </code></pre>
  
  <p>=============== META-INF
  Created-By: Apache Maven
  Built-By: 
  Build-Jdk: 1.6.0_30
  Class-Path: jersey-servlet-1.12.jar jersey-server-1.12.jar asm-3.1.jar
    jersey-core-1.12.jar</p>
  
  <p>============= In command line (Only ViewableMessageBodyWriter is available)</p>
  
  <pre><code>GN MBR:class com.sun.jersey.server.impl.template.ViewableMessageBodyWriter CP:co
  m.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@28946
  139 C:com.sun.jersey.server.impl.template.ViewableMessageBodyWriter@6a7d46b8
  </code></pre>
  
  <p>============= In eclipse (All jersey provider are avaialbe)</p>
  
  <pre><code>GN MBR:class com.sun.jersey.server.impl.template.ViewableMessageBodyWriter CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@2fba32e3 C:com.sun.jersey.server.impl.template.ViewableMessageBodyWriter@60039882
  GN MBR:class com.sun.jersey.core.impl.provider.entity.StringProvider CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@6962ed8f C:com.sun.jersey.core.impl.provider.entity.StringProvider@31cc3e7c
  GN MBR:class com.sun.jersey.core.impl.provider.entity.ByteArrayProvider CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@5dda7d56 C:com.sun.jersey.core.impl.provider.entity.ByteArrayProvider@1af30c34
  GN MBR:class com.sun.jersey.core.impl.provider.entity.FileProvider CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@335ac93d C:com.sun.jersey.core.impl.provider.entity.FileProvider@6695c13b
  GN MBR:class com.sun.jersey.core.impl.provider.entity.InputStreamProvider CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@d51de22 C:com.sun.jersey.core.impl.provider.entity.InputStreamProvider@4592b04e
  GN MBR:class com.sun.jersey.core.impl.provider.entity.DataSourceProvider CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@79ce9102 C:com.sun.jersey.core.impl.provider.entity.DataSourceProvider@41fb404
  GN MBR:class com.sun.jersey.core.impl.provider.entity.RenderedImageProvider CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@689258c7 C:com.sun.jersey.core.impl.provider.entity.RenderedImageProvider@4c843d2b
  GN MBR:class com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@6002a673 C:com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider@20f1fbb4
  GN MBR:class com.sun.jersey.core.impl.provider.entity.FormProvider CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@4dfdf943 C:com.sun.jersey.core.impl.provider.entity.FormProvider@44d0d6fd
  GN MBR:class com.sun.jersey.core.impl.provider.entity.FormMultivaluedMapProvider CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@5cf7c5b5 C:com.sun.jersey.core.impl.provider.entity.FormMultivaluedMapProvider@29dafde4
  GN MBR:class com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@ed51dc2 C:com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App@8c5697a
  GN MBR:class com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$Text CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@4994b329 C:com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$Text@48e14b1f
  GN MBR:class com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@417e6e7c C:com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General@6c9ce1cb
  GN MBR:class com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$App CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@5387b07b C:com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$App@2acb4dcf
  GN MBR:class com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@71538614 C:com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text@59b02f33
  GN MBR:class com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@2287c52c C:com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General@9fc1ec5
  GN MBR:class com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$App CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@7fa1dd69 C:com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$App@7a95626d
  GN MBR:class com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$Text CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@5bcf59f5 C:com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$Text@1e69555f
  GN MBR:class com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@a1b12ea C:com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General@4feaf536
  GN MBR:class com.sun.jersey.core.impl.provider.entity.ReaderProvider CP:com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider@7776c5d4 C:com.sun.jersey.core.impl.provider.entity.ReaderProvider@5d66341b
  </code></pre>
  
  <p>...</p>
  
  <p>============= Full Error Stack ==================</p>
  
  <pre><code>23-May-2012 12:05:54 com.sun.jersey.spi.container.ContainerResponse write
  SEVERE: The registered message body writers compatible with the MIME media type
  are:
  */* -&gt;
    com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
  
  23-May-2012 12:05:54 com.sun.jersey.spi.container.ContainerResponse logException
  
  SEVERE: Mapped exception to response: 500 (Internal Server Error)
  javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException: A message body writer for Java class com.test.TestRest, and Java type class com.test.TestRest, and MIME media type application/xml was not found
          at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:285)
          at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1451)
          at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1363)
          at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1353)
          at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:414)
          at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
          at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:708)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
          at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
          at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
          at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
          at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
          at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
          at org.mortbay.jetty.Server.handle(Server.java:326)
          at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
          at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:926)
          at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
          at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
          at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
          at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
          at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
  Caused by: com.sun.jersey.api.MessageException: A message body writer for Java class com.test.TestRest, and Java type class com.test.TestRest, and MIME media type application
  /xml was not found
          ... 21 more
  </code></pre>
  
  <p>============= Start Jetty Server ====
  I am using Jetty Web Server, and started the server like this: </p>
  
  <pre><code>Context root = new Context(server, "/", Context.SESSIONS); 
  // Add REST handlers and Singleton providers 
  ResourceConfig rc = new PackagesResourceConfig("handlerpkg"); 
  
  // Add the Jersey root servlet holder to the root context 
  root.addServlet(new ServletHolder(new ServletContainer(rc)), "/*");
  
  server.start();
  </code></pre>