title: readEntity on custom class throws MessageBodyProviderNotFoundException
body: <p>I am developing a RESTful API in Java for a class.
  I am using JAX-RS has I followed this tutorial <a href="https://howtodoinjava.com/jersey/jersey-rest-security/" rel="nofollow noreferrer">"JAX-RS Jersey"</a>.
  Everything works has expected except when I tried to perform <code>response.readEntity(MyTable.class)</code> to create a new <code>Object</code> of the <code>MyTable</code> class that I have created.
  This works fine for a <code>String.class</code> has it reads all the <code>JSON</code> information as a string, but it cannot parse it to a new <code>Object</code> of my custom class.
  I've read a lot on this and I have set all the setters and getters for the attributes and an empty <code>constructor</code> but it cannot parse the information to a new object of my custom class. I get the <code>MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=application/json, type=class com.beans.MyTable, genericType=class com.beans.MyTable.</code> error.</p>
  
  <h1>MyTable.java</h1>
  
  <pre><code> private Integer id;
      private String name;
  
      public MyTable() {
  
      }
  
      public MyTable(Integer id, String name) {
          this.id = id;
          this.name = name;
      }
  
      public Integer getId() {
          return id;
      }
  
      public void setId(Integer id) {
          this.id = id;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      @Override
      public String toString() {
          return "MyTable [id=" + id + ", name=" + name + "]";
      }
  </code></pre>
  
  <h1>MyClient.java</h1>
  
  <pre><code>Client client = ClientBuilder.newClient( new ClientConfig().register( LoggingFeature.class ) );
  WebTarget webTarget = client.target("http://localhost:8080/App/rest").path("test");
  
  Invocation.Builder invocationBuilder =  webTarget.request(MediaType.APPLICATION_JSON);
  Response response = invocationBuilder.get();
  
  //Does not work and gives error
  MyTable table = response.readEntity(MyTable.class);
  System.out.println(table.toString());
  </code></pre>
  
  <h1>MyService.java</h1>
  
  <pre><code>@PermitAll
      @GET
      @Produces(MediaType.APPLICATION_JSON)
      public Response test() {
          MyTable table = new MyTable();
          table.setId(1);
          table.setName("mesa de teste");
  
          GenericEntity&lt;MyTable&gt; genericEntity = new GenericEntity&lt;MyTable&gt;(table, MyTable.class);
          return Response.ok().entity(genericEntity).build();
      }
  </code></pre>
  
  <h1>ERROR</h1>
  
  <pre><code>Exception in thread "main" org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=application/json, type=class com.beans.MyTable, genericType=class com.beans.MyTable.
      at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:231)
      at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:155)
      at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:1085)
      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:326)
      at org.glassfish.jersey.client.InboundJaxrsResponse$1.call(InboundJaxrsResponse.java:115)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
      at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:419)
      at org.glassfish.jersey.client.InboundJaxrsResponse.runInScopeIfPossible(InboundJaxrsResponse.java:267)
      at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:112)
      at com.client.MyClient.main(MyClient.java:31)
  </code></pre>