title: CXF 3.0 and Spring - No message body reader has been found for response Class
body: <p>I'm writing a JSX-RS based Spring+CXF client for a service that sends a simple response as below.</p>
  
  <p><strong>JSON : Response</strong> </p>
  
  <pre><code>{
      "message": "Hey Karthik"
  }
  </code></pre>
  
  <p><strong>I have the following configuration in my spring.xml:</strong></p>
  
  <pre><code>&lt;jaxrs:providers&gt;
  &lt;bean class="org.apache.cxf.jaxrs.provider.json.JSONProvider"&gt;
  &lt;property name="dropRootElement" value="true" /&gt;
  &lt;/bean&gt;
  &lt;/jaxrs:providers&gt;
  </code></pre>
  
  <p>My entity class looks like this</p>
  
  <pre><code>@XmlRootElement
  public class HiModel {
  
      private String message;
  
      public HiModel(){}
      .
      .
      .
  }
  </code></pre>
  
  <p><strong>My JAX-RS client is like this:</strong></p>
  
  <pre><code>@Test
  public void getMessage(){
      WebClient client = WebClient.create("http://localhost:8182");
      client.path("hiService/sayHi/hi");
     client.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON);
      Response r = client.get();
      System.out.println(r.readEntity(HiModel.class));
  
  }
  </code></pre>
  
  <p>I get the error : <strong>No message body reader has been found for class com.karthik.model.HiModel, ContentType: application/json</strong></p>
  
  <p>How do I resolve it? There are lots of questions with the method I chose to write as client, but I first need to get this resolved. Please help.</p>
  
  <p><strong>EDIT 1 : I can resolve it by</strong> </p>
  
  <pre><code>System.out.println(r.readEntity(String.class));
  </code></pre>
  
  <p>But, How do I resolve it with the entity as <strong><em>HiModel.class</em></strong></p>