title: HtmlUnit on webserver: method <init>()V not found
body: <p>I've managed to run the code in this question <a href="https://stackoverflow.com/questions/9081743/how-to-call-getpage-from-htmlunit-webclient-and-have-settimeout-not-wait-forever">here</a> properly in a test java project with no problem, but when I am following the exact same procedure to import HtmlUnit in my webserver, i keep getting the <code>org.apache.http.protocol.BasicHttpContext: method &lt;init&gt;()V not found</code> error. </p>
  
  <p>the code im trying to run:</p>
  
  <pre><code>    package com.testing;
  
  import java.io.IOException;
  import java.net.MalformedURLException;
  
  import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
  import com.gargoylesoftware.htmlunit.WebClient;
  
  public class testingUnit {
  
      public static void main(final String[] args) {
          final WebClient webClient = new WebClient();
          webClient.setTimeout(1000);
          try {
              System.out.println("Querying");
              webClient.getPage("https://bulksms.vsms.net/register/");
              System.out.println("Success");
          } catch (final FailingHttpStatusCodeException e) {
              System.out.println("One");
              e.printStackTrace();
          } catch (final MalformedURLException e) {
              System.out.println("Two");
              e.printStackTrace();
          } catch (final IOException e) {
              System.out.println("Three");
              e.printStackTrace();
          } catch (final Exception e) {
              System.out.println("Four");
              e.printStackTrace();
          }
          System.out.println("Finished");
      }
  
  }
  </code></pre>
  
  <p>Console:</p>
  
  <pre><code>Querying
  Exception in thread "main" java.lang.NoSuchMethodError: org.apache.http.protocol.BasicHttpContext: method &lt;init&gt;()V not found
      at org.apache.http.impl.client.AbstractHttpClient.createHttpContext(AbstractHttpClient.java:273)
      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:797)
      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776)
      at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:152)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1439)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1358)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:307)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:373)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:358)
      at com.testing.testingUnit.main(testingUnit.java:16)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/NramG.png" alt="enter image description here"></p>