title: RESTEASY004655: Unable to invoke request: org.apache.http.NoHttpResponseException: host_url failed to respond
body: <p>Sometimes (happens randomly, sometimes after one Requests and sometimes after 10) my Batch-Job crashes with the following Exception:</p>
  <pre><code>javax.ws.rs.ProcessingException: RESTEASY004655: Unable to invoke request: org.apache.http.NoHttpResponseException: host_url failed to respond
      at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:327)
      at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:443)
      at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:63)
      at org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.post(ClientInvocationBuilder.java:227)
  </code></pre>
  <p>The exception is triggered from the following code:</p>
  <pre><code>public YpspResponse sendRequest(YpspRequest request) {
          return webTarget
                  .request(MediaType.APPLICATION_XML)
                  .post(Entity.xml(request))
                  .readEntity(YpspResponse.class);
      }
  </code></pre>
  <p>WebTarget is initialized with this code:</p>
  <pre><code>            ResteasyClientBuilder builder = new ResteasyClientBuilder()
                      .socketTimeout(30, TimeUnit.SECONDS)
                      .connectTimeout(5, TimeUnit.SECONDS)
                      .connectionPoolSize(500)
                      .keyStore(keyStore, ynetKeystorePassword.toCharArray())
                      .trustStore(trustStore);
  
              if (proxyConfiguration.useProxy()){
                  logger.info(&quot;{}&quot;, proxyConfiguration.getHost());
                  builder.defaultProxy(proxyConfiguration.getHost(), proxyConfiguration.getPort());
              }
  
              return builder
                      .build()
                      .target(ynetUrl)
                      .register(messageBodyReader)
                      .register(loggingFilter)
                      .register((ClientRequestFilter) requestContext -&gt; {
                          byte[] auth = (username + &quot;:&quot; + password).getBytes(&quot;UTF-8&quot;);
                          requestContext.getHeaders().putSingle(HttpHeaders.AUTHORIZATION, &quot;BASIC &quot; + Base64.getEncoder().encodeToString(auth));
                          requestContext.getHeaders().putSingle(&quot;version&quot;, &quot;1.1&quot;);
                      });
  
  </code></pre>
  <p>I am using RESTEASY: 3.12.1.FINAL</p>
  <p>It appears that the <code>ResteasyClient</code> tries to use an already used connection instead of a new one. How can I fix this issue?</p>