title: Solr new HttpSolrClient.Builder( str ) causing java.lang.NoClassDefFoundError: org/apache/http/impl/client/SystemDefaultHttpClient
body: <p>Having problems with Sorl. when trying to run the following line of code:</p>
  
  <pre><code>HttpSolrClient solr = new HttpSolrClient.Builder( "http://localhost:8983/solr/core" ).build();
  </code></pre>
  
  <p>I get the following error: 
  Caused by: java.lang.NoClassDefFoundError: </p>
  
  <pre><code>org/apache/http/impl/client/SystemDefaultHttpClient
      at org.apache.solr.client.solrj.impl.HttpSolrClient.&lt;init&gt;(HttpSolrClient.java:211)
      at org.apache.solr.client.solrj.impl.HttpSolrClient.&lt;init&gt;(HttpSolrClient.java:228)
      at org.apache.solr.client.solrj.impl.HttpSolrClient$Builder.build(HttpSolrClient.java:890)
  </code></pre>
  
  <p>I read on a couple posts that it could be a dependency issue with Maven since both Swagger and Sorl use httpClient. I moved my dependencies to the same pom and I wrapped dependencies within the <code>dependencymanagement</code> tag.</p>
  
  <p>After doing this I ran the command: <code>mvn dependency:tree -Dverbose</code></p>
  
  <p>Looking at the tree, it is clear that the duplicate dependency is removed. However, i still get the same error.</p>
  
  <p>Using:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.apache.solr&lt;/groupId&gt;
      &lt;artifactId&gt;solr-solrj&lt;/artifactId&gt;
      &lt;version&gt;6.6.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Any help would be appreciated!</p>