title: ClientHandlerException in REST client only when executing jar file
body: <p>I have set up a REST Webservice and a Client. The Webservice is deployed on a Glassfish server. If I run the main class of the client out of netbeans everything works fine. Now I use Maven to create a executable jar file and if I try to run this jar file I get the following exception message: </p>
  
  <pre><code>21.07.2013 13:40:05 com.sun.jersey.api.client.ClientResponse getEntity
  SCHWERWIEGEND: A message body reader for Java class java.lang.String, and Java type class java.lang.String, and MIME media type application/xml was not found
  21.07.2013 13:40:05 com.sun.jersey.api.client.ClientResponse getEntity
  SCHWERWIEGEND: The registered message body readers compatible with the MIME media type are:
  */* -&gt;
    com.sun.jersey.atom.rome.impl.provider.entity.AtomFeedProvider
    com.sun.jersey.atom.rome.impl.provider.entity.AtomEntryProvider
  
  Exception in thread "main" com.sun.jersey.api.client.ClientHandlerException: A message body reader for Java class java.lang.String, and Java type class java.lang.String, and MIME media type application/xml was not found
      at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:561)
      at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:517)
      at com.sun.jersey.api.client.WebResource.handle(WebResource.java:684)
      at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
      at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:507)
      at de.movienexuscmd.MovieNexusWebserviceClient.getXml(MovieNexusWebserviceClient.java:52)
      at de.movienexuscmd.App.run(App.java:20)
      at de.movienexuscmd.App.main(App.java:16)
  </code></pre>
  
  <p>Now I really don't know why this Exception appears only when trying to execute the jar file.  Hope anyone can help. </p>
  
  <p>My Webservice looks like: </p>
  
  <pre><code>@Path("MovieNexus")
  public class MovieNexusWebService {
  
  @Context
  private UriInfo context;
  
  private MovieNexusFrontController frontController = null;
  
  /**
   * Creates a new instance of MovieNexusWebService
   */
  public MovieNexusWebService() {
      frontController = new MovieNexusFrontController();
  }
  
  /**
   * Retrieves representation of an instance of
   * de.webservice.MovieNexusWebService
   *
   * @return an instance of java.lang.String
   */
  @GET
  @Produces("application/xml")
  public String getXml() {
      return frontController.getRandomMovie().getMovieName();
  }
  
  /**
   * PUT method for updating or creating an instance of MovieNexusWebService
   *
   * @param content representation for the resource
   * @return an HTTP response with content of the updated or created resource.
   */
  @PUT
  @Consumes("application/xml")
  public void putXml(String content) {
  }
  }
  </code></pre>
  
  <p>The Client:</p>
  
  <pre><code>public class MovieNexusWebserviceClient {
  
  private WebResource webResource;
  
  private Client client;
  
  private static final String BASE_URI = "http://localhost:17589/MovieNexusWebservice/webresources";
  
  public MovieNexusWebserviceClient() {
      com.sun.jersey.api.client.config.ClientConfig config = new com.sun.jersey.api.client.config.DefaultClientConfig();
      client = Client.create(config);
      webResource = client.resource(BASE_URI).path("MovieNexus");
  }
  
  public String getXml() throws UniformInterfaceException {
      WebResource resource = webResource;
      return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_XML).get(String.class);
  }
  
  public void putXml(Object requestEntity) throws UniformInterfaceException {
      webResource.type(javax.ws.rs.core.MediaType.APPLICATION_XML).put(requestEntity);
  }
  
  public void close() {
      client.destroy();
  }
  }
  </code></pre>
  
  <p>greetings </p>
  
  <p>Noah</p>