title: Resteasy Client java.lang.IllegalStateException: Response is closed
body: <p>I am getting below exception in RestEasy client -3.0.8</p>
  
  <blockquote>
    <p>12:46:19,724 ERROR [stderr] (http-localhost-127.0.0.1-8080-1)
    java.lang.IllegalStateException: Response is closed.</p>
  </blockquote>
  
  <p>I have write below code</p>
  
  <pre><code>client = new ResteasyClientBuilder().build();
  ResteasyWebTarget target = client.target(request.getUrl());
  Response response = target.request().accept(APPLICATION_TYPE_XML).header(TOKEN, request.getToken()).post(Entity.entity(request.getXmlObject(), APPLICATION_TYPE_XML));
  output = response.readEntity(String.class);
  if (response.getStatus() != SUCCESS_CREATE) {
   //Do Something
  } else {
   String classType = ClassFactory.getClassNameFromUrl(request.getUrl());
   if (null != classType &amp;&amp; !classType.isEmpty()) {
    Long Id = (Long) response.readEntity(ClassFactory.getClassMethod(classType)).getId();
  
   }
  </code></pre>
  
  <p>Now this line <code>Long Id = (Long) response.readEntity(ClassFactory.getClassMethod(classType)).getId();</code> throwing exception . Whats wrong with the code?</p>