title: DefaultHttpClient throws InvocationTargetException
body: <p>I am trying to consume a RESTful web service using Java, and have been following the tutorial on <a href="http://hc.apache.org/httpcomponents-client-dev/tutorial/html/authentication.html" rel="nofollow">4.8 Preemptive Authentication</a>.</p>
  
  <p>However, I keep getting an InvocationTargetException error, and started moving bits and pieces of the code out to track down the source.</p>
  
  <p>I have my code down to essentially one functional line:</p>
  
  <pre class="lang-java prettyprint-override"><code>import java.io.IOException;
  import org.apache.http.impl.client.DefaultHttpClient;
  
  public class TestRestClient() {
  
    public void doStuff() {
      DefaultHttpClient client = new DefaultHttpClient();
    }
  
  }
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Edit: <a href="http://pastebin.com/P92fHvWm" rel="nofollow">Result of getAllStackTrace() in a finally block</a></p>