title: Jersey Client throws MessageBodyProviderNotFoundException
body: <p>I have a Jersey client that throws MessageBodyProviderNotFoundException
  In my example, I can parse the JSON read from a file with moxy, I then try to use the Jersey Client to parse the same JSON</p>
  
  <p>I inspected the WarehouseResponse instance created by the moxy parsing and it looks perfect.</p>
  
  <p>My dependencies </p>
  
  <pre><code>  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.jersey.core&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-client&lt;/artifactId&gt;
          &lt;version&gt;2.27&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.ca.Plex&lt;/groupId&gt;
          &lt;artifactId&gt;ObRun&lt;/artifactId&gt;
          &lt;version&gt;7.2.1.002&lt;/version&gt;
          &lt;scope&gt;system&lt;/scope&gt;
          &lt;systemPath&gt;C:/ProgramData/CA/Plex/7.2.1/ObJava/lib/ObRun.jar&lt;/systemPath&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.jersey.media&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-media-moxy&lt;/artifactId&gt;
          &lt;version&gt;2.27&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.ws.rs&lt;/groupId&gt;
          &lt;artifactId&gt;javax.ws.rs-api&lt;/artifactId&gt;
          &lt;version&gt;2.1.1&lt;/version&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.jersey.core&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-common&lt;/artifactId&gt;
          &lt;version&gt;2.27&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.jersey.inject&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-hk2&lt;/artifactId&gt;
          &lt;version&gt;2.27&lt;/version&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  </code></pre>
  
  <p>Example code</p>
  
  <pre><code>public class PlexExample {
  
      public static void main(String[] args) throws Exception {
          Class&lt;?&gt;[] ctx = {WarehousesResponse.class, WarehouseResponse.class, WarehouseFields.class};
          JAXBContext jc = JAXBContext.newInstance(ctx);
          Unmarshaller um = jc.createUnmarshaller();
          um.setProperty(UnmarshallerProperties.MEDIA_TYPE, "application/json");
          um.setProperty(UnmarshallerProperties.JSON_INCLUDE_ROOT, false);
          Source json = new StreamSource(new File("D:\\CM_First\\Pacorini\\Workspace\\Resources\\warehouses.json"));
          WarehousesResponse warehouses = um.unmarshal(json, WarehousesResponse.class).getValue();
          ObCharFld url = new ObCharFld("http://localhost:8080/HSyncREST007/api/v1");
          ObCharFld path = new ObCharFld("warehouses");
          warehouses = executeGET(url, path);
      }
  
      public static WarehousesResponse executeGET(ObCharFld obUri, ObCharFld obPath) {
          Client client = ClientBuilder.newClient();
          WebTarget target = client.target(obUri.getValue())
                  .path(obPath.getValue());
          Invocation.Builder builder = target.request(MediaType.APPLICATION_JSON);
          Response response = builder.get();
          return  response.readEntity(WarehousesResponse.class); // Exception thrown here
      }
  }
  </code></pre>
  
  <p>Stack trace</p>
  
  <pre><code>Exception in thread "main" org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=text/x-json;charset=UTF-8, type=class com.pacorini.rest.client.WarehousesResponse, genericType=class com.pacorini.rest.client.WarehousesResponse.
      at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:232)
      at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:156)
      at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:1091)
      at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:874)
      at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:808)
      at org.glassfish.jersey.client.ClientResponse.readEntity(ClientResponse.java:321)
      at org.glassfish.jersey.client.InboundJaxrsResponse$1.call(InboundJaxrsResponse.java:115)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:229)
      at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:389)
      at org.glassfish.jersey.client.InboundJaxrsResponse.runInScopeIfPossible(InboundJaxrsResponse.java:264)
      at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:112)
      at com.pacorini.rest.client.PlexExample.executeGET(PlexExample.java:41)
      at com.pacorini.rest.client.PlexExample.main(PlexExample.java:32)
  </code></pre>