java.lang.NoSuchFieldError: INSTANCE

Apache's JIRA Issue Tracker | Sugat Sapkota | 4 months ago
  1. 0

    Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE

    Stack Overflow | 4 months ago | Chuchoo
    java.lang.NoSuchFieldError: INSTANCE
  2. 0

    I am trying to write a simple WebService Testing using HTTPClient. I have all my jars loaded up but get the above error message. I am getting the above error stacktrace. {|borderStyle=solid} package HTTPClientTest; import; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.impl.client.HttpClientBuilder; import org.junit.Assert; public class RESTTester { public static void main (String args[]) { String restURL_XML = ""; try { testStatusCode(restURL_XML); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } public static void testStatusCode(String restURL) throws ClientProtocolException, IOException { HttpUriRequest request = new HttpGet(restURL); HttpResponse httpResponse = HttpClientBuilder.create().build().execute(request); Assert.assertEquals(httpResponse.getStatusLine().getStatusCode(),HttpStatus.SC_OK); } } {code} {code} Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>( at at HTTPClientTest.RESTTester.testStatusCode( at HTTPClientTest.RESTTester.main( {code}

    Apache's JIRA Issue Tracker | 4 months ago | Sugat Sapkota
    java.lang.NoSuchFieldError: INSTANCE
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    NoSuchFieldError: INSTANCE] with root cause

    GitHub | 2 years ago | johnanthony3
    java.lang.NoSuchFieldError: INSTANCE

    7 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NoSuchFieldError


      at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>()
    2. Apache HttpClient
      1. org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(
      2 frames
    3. HTTPClientTest
      1. HTTPClientTest.RESTTester.testStatusCode(
      2. HTTPClientTest.RESTTester.main(
      2 frames