title: how to run jersey server from the jar (eclipse)
body: <p>I used jersey to develop a small server doing</p>
  
  <pre><code>HttpServer server = HttpServerFactory.create("http://localhost:9998/");
  server.start();
  </code></pre>
  
  <p>and a small api like this:</p>
  
  <pre><code>@GET
  @Path("serverconnectiontest")
  @Produces(MediaType.APPLICATION_JSON)
  public CommunicationResponseM isDatabaseOnline()
  {
      CommunicationResponseM result = new CommunicationResponseM();
  
  
      return result;
  }
  </code></pre>
  
  <p>in eclipse if I start the server with right_click->run as->java application all go well, so if I type the path in my web browser I can see the server response..</p>
  
  <p>now I want to make a jar of my server, so I do:
  right_click->export->runanble_jar  and I get the jar file.. but if I ran this jar using "java -jar file.jat" the server doesn't respond and give me this error:</p>
  
  <pre><code>com.sun.jersey.spi.container.ContainerResponse write
  SEVERE: A message body writer for Java class
  it.unitn.se.gym.backend.models.CommunicationResponseM, and Java type class 
  it.unitn.se.gym.backend.models.CommunicationResponseM, and MIME media type
  application/json was not found
  
  Mar 14, 2013 6:59:10 PM com.sun.jersey.spi.container.ContainerResponse write
  
  SEVERE: The registered message body writers compatible with the MIME media type are:
  application/json -&gt; 
  com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$App
  com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$App
  com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$App
  com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$App
  com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$App
  
  com.sun.jersey.core.impl.provider.entity.FormProvider
  com.sun.jersey.core.impl.provider.entity.StringProvider
  com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
  com.sun.jersey.core.impl.provider.entity.FileProvider
  com.sun.jersey.core.impl.provider.entity.InputStreamProvider
  com.sun.jersey.core.impl.provider.entity.DataSourceProvider
  com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
  com.sun.jersey.core.impl.provider.entity.ReaderProvider
  com.sun.jersey.core.impl.provider.entity.DocumentProvider
  com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider
  com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter
  com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
  com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
  com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
  com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
  com.sun.jersey.json.impl.provider.entity.JSONWithPaddingProvider
  com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
  com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
  com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
  com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
  com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy
  
  Mar 14, 2013 6:59:10 PM 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 it.unitn.se.gym.backend.models.CommunicationResponseM, and Java type   
  class it.unitn.se.gym.backend.models.CommunicationResponseM, and MIME media type   
  application/json 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:1479)
  at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
  at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
  at com.sun.jersey.server.impl.container.httpserver.HttpHandlerContainer.handle(HttpHandlerContainer.java:191)
  at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
  at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
  at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
  at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:557)
  at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
  at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:529)
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
  at java.lang.Thread.run(Thread.java:680)
   Caused by: com.sun.jersey.api.MessageException: A message body writer for Java class    
  it.unitn.se.gym.backend.models.CommunicationResponseM, and Java type class     
  it.unitn.se.gym.backend.models.CommunicationResponseM, and MIME media type   
  application/json was not found
  </code></pre>
  
  <p>can you help me?</p>
  
  <p>thnaks  a lot!</p>
  
  <p>if I try to </p>