title: Error while trying to use an API. java.lang.NoSuchFieldError: INSTANCE
body: <p>I am trying to connect to the smartsheet api using a java program.
  Initially I had problems with the site certificate which was resolved by adding it to the java keystore. Now when I am trying to run my code, I get the following error.</p>
  
  <pre><code>Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE
      at org.apache.http.conn.ssl.SSLConnectionSocketFactory.&lt;clinit&gt;(SSLConnectionSocketFactory.java:144)
      at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:955)
      at org.apache.http.impl.client.HttpClients.createDefault(HttpClients.java:58)
      at com.smartsheet.api.internal.http.DefaultHttpClient.&lt;init&gt;(DefaultHttpClient.java:64)
      at com.smartsheet.api.SmartsheetBuilder.build(SmartsheetBuilder.java:203)
      at SmartsheetConnection.main(SmartsheetConnection.java:13)
  </code></pre>
  
  <p>This is my code (I followed their documentation).</p>
  
  <pre><code>import com.smartsheet.api.*;
  import com.smartsheet.api.models.*;
  import com.smartsheet.api.models.enums.*;
  import com.smartsheet.api.oauth.*;
  
  public class SmartsheetConnection {
      public static void main(String[] args) throws SmartsheetException {
          // Set the access token.
          Token token = new Token();
          token.setAccessToken("foo");
          Smartsheet smartsheet = new SmartsheetBuilder().setAccessToken(token.getAccessToken()).build();
      }
  }
  </code></pre>
  
  <p>The line that is throwing error is (line 144)</p>
  
  <pre><code>@Deprecated
      public static final X509HostnameVerifier ALLOW_ALL_HOSTNAME_VERIFIER
          = AllowAllHostnameVerifier.INSTANCE; 
  </code></pre>
  
  <p>but I am not sure what to make of it. I am using maven to get the dependencies. Does it have something to do with the version of the Apache HttpComponents?</p>
  
  <p>Here is the pom.xml</p>
  
  <pre><code>    &lt;build&gt;
          &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.4&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;warSourceDirectory&gt;WebContent&lt;/warSourceDirectory&gt;
                      &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.smartsheet&lt;/groupId&gt;
              &lt;artifactId&gt;smartsheet-sdk-java&lt;/artifactId&gt;
              &lt;version&gt;2.0.2&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey.contribs&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-apache-client&lt;/artifactId&gt;
              &lt;version&gt;1.9&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>