title: Attaching Apache HTTP Client to RESTlet client
body: <p>I'm using RESTlet as Server and Client. Server is running over Tomcat and I can access it from browser.</p>
  
  <p>For Client, I'm using org.restlet.resource.ClientResource. It works fine if I send a few requests to that server, but if I send a few hundred calls it breaks:</p>
  
  <pre><code>Fev 20, 2013 12:59:43 PM org.restlet.engine.connector.ClientConnectionHelper start
  INFO: Starting the internal [HTTP/1.1] client
  (some calls work)
  Fev 20, 2013 1:00:49 PM org.restlet.util.SelectionRegistration block
  WARNING: The thread blocked at the cyclic barrier has timed out
  java.util.concurrent.TimeoutException
      at java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:250)
      at java.util.concurrent.CyclicBarrier.await(CyclicBarrier.java:427)
      at org.restlet.util.SelectionRegistration.block(SelectionRegistration.java:191)
      at org.restlet.engine.io.NbChannelInputStream.onFill(NbChannelInputStream.java:230)
      at org.restlet.engine.io.Buffer.process(Buffer.java:601)
      at org.restlet.engine.io.NbChannelInputStream.read(NbChannelInputStream.java:307)
      at java.io.InputStream.read(InputStream.java:101)
      at org.restlet.engine.io.BioUtils.copy(BioUtils.java:80)
      at org.restlet.engine.io.NioUtils.copy(NioUtils.java:147)
      at org.restlet.representation.ReadableRepresentation.write(ReadableRepresentation.java:104)
      at org.restlet.representation.ChannelRepresentation.write(ChannelRepresentation.java:76)
      at org.restlet.representation.ChannelRepresentation.write(ChannelRepresentation.java:82)
  
  Exception in thread "main" java.io.IOException: The thread blocked at the cyclic barrier has timed out.
      at org.restlet.util.SelectionRegistration.block(SelectionRegistration.java:197)
      at org.restlet.engine.io.NbChannelInputStream.onFill(NbChannelInputStream.java:230)
      at org.restlet.engine.io.Buffer.process(Buffer.java:601)
      at org.restlet.engine.io.NbChannelInputStream.read(NbChannelInputStream.java:307)
      at java.io.InputStream.read(InputStream.java:101)
      at org.restlet.engine.io.BioUtils.copy(BioUtils.java:80)
      at org.restlet.engine.io.NioUtils.copy(NioUtils.java:147)
      at org.restlet.representation.ReadableRepresentation.write(ReadableRepresentation.java:104)
      at org.restlet.representation.ChannelRepresentation.write(ChannelRepresentation.java:76)
      at org.restlet.representation.ChannelRepresentation.write(ChannelRepresentation.java:82)
  Caused by: java.util.concurrent.TimeoutException
      at java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:250)
      at java.util.concurrent.CyclicBarrier.await(CyclicBarrier.java:427)
      at org.restlet.util.SelectionRegistration.block(SelectionRegistration.java:191)
      ... 11 more
  </code></pre>
  
  <p>I wanna use Apache HTTP Client to be able to do more calls, but I can't find documentation on how to attach it.</p>