java.lang.NoSuchFieldError

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • GitHub comment 8#244574417
    via GitHub by angelo337
    ,
  • 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. {code:title=RESTTester.java|borderStyle=solid} package HTTPClientTest; import java.io.IOException; 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 = "http://parabank.parasoft.com/parabank/services/bank/customers/12212/"; 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>(SSLConnectionSocketFactory.java:144) at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:966) at HTTPClientTest.RESTTester.testStatusCode(RESTTester.java:37) at HTTPClientTest.RESTTester.main(RESTTester.java:22) {code}
    via by Sugat Sapkota,
  • GitHub comment 71#130720405
    via GitHub by sectioneight
    ,
  • GitHub comment 56#194288970
    via GitHub by fatihcalis
    ,
    • java.lang.NoSuchFieldError: INSTANCE at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:144) at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:966) at com.norconex.collector.http.client.impl.GenericHttpClientFactory.createHTTPClient(GenericHttpClientFactory.java:306) at com.norconex.collector.http.crawler.HttpCrawler.initializeHTTPClient(HttpCrawler.java:442) at com.norconex.collector.http.crawler.HttpCrawler.prepareExecution(HttpCrawler.java:116) at com.norconex.collector.core.crawler.AbstractCrawler.doExecute(AbstractCrawler.java:204) at com.norconex.collector.core.crawler.AbstractCrawler.startExecution(AbstractCrawler.java:179) at com.norconex.jef4.job.AbstractResumableJob.execute(AbstractResumableJob.java:49) at com.norconex.jef4.suite.JobSuite.runJob(JobSuite.java:350) at com.norconex.jef4.suite.JobSuite.doExecute(JobSuite.java:300) at com.norconex.jef4.suite.JobSuite.execute(JobSuite.java:172) at com.norconex.collector.core.AbstractCollector.start(AbstractCollector.java:120) at com.norconex.collector.core.AbstractCollectorLauncher.launch(AbstractCollectorLauncher.java:80) at com.norconex.collector.http.HttpCollector.main(HttpCollector.java:75)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    23 more bugmates