question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.NoSuchMethodError: org.apache.http.conn.ssl.SSLSocketFactory.<init>(Ljavax/net/ssl/SSLContext;Lorg/apache/http/conn/ssl/X509HostnameVerifier;)

See original GitHub issue

I’m seeing the same as : https://github.com/tomakehurst/wiremock/issues/149 I’m currently using robolectric & retrofit for web services, and can’t get wiremock to work with this stack.

ava.lang.NoSuchMethodError: org.apache.http.conn.ssl.SSLSocketFactory.<init>(Ljavax/net/ssl/SSLContext;Lorg/apache/http/conn/ssl/X509HostnameVerifier;)V
    at com.github.tomakehurst.wiremock.http.HttpClientFactory.createSslSocketFactory(HttpClientFactory.java:110)
    at com.github.tomakehurst.wiremock.http.HttpClientFactory.createClientConnectionManagerWithSSLSettings(HttpClientFactory.java:88)
    at com.github.tomakehurst.wiremock.http.HttpClientFactory.createClient(HttpClientFactory.java:54)
    at com.github.tomakehurst.wiremock.http.HttpClientFactory.createClient(HttpClientFactory.java:70)
    at com.github.tomakehurst.wiremock.http.HttpClientFactory.createClient(HttpClientFactory.java:74)
    at com.github.tomakehurst.wiremock.http.HttpClientFactory.createClient(HttpClientFactory.java:78)
    at com.github.tomakehurst.wiremock.client.HttpAdminClient.<init>(HttpAdminClient.java:58)
    at com.github.tomakehurst.wiremock.client.HttpAdminClient.<init>(HttpAdminClient.java:62)
    at com.github.tomakehurst.wiremock.client.WireMock.<init>(WireMock.java:52)
    at com.github.tomakehurst.wiremock.client.WireMock.<clinit>(WireMock.java:41)
    at com.joshskeen.weatherview.WeatherviewWebserviceTest.testGetCurrentWeatherReturnsExpected(WeatherviewWebserviceTest.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:250)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:77)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:56)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:177)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

I have the code at https://github.com/mutexkid/weatherview/ and am unsure if wiremock is compatible with this setup. Please let me know if you have any insight into how i might troubleshoot this. Thanks!

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
tomakehurstcommented, Oct 29, 2014

You’re on a pretty old version of WireMock there. Have you tried the latest? HTTPClient has been upgraded recently.

0reactions
tobilarscheidcommented, Sep 10, 2017

Hi,

we still have the very same issue when running with latest wiremock and robolectric

Read more comments on GitHub >

github_iconTop Results From Across the Web

NoSuchMethodError: org.apache.http.conn.ssl ...
I keep getting: Exception in thread "main" java.lang.NoSuchMethodError: org.apache.
Read more >
org.apache.http.conn.ssl.SSLConnectionSocketFactory · Issue ...
I was using version 1.10.0 but I had to upgrade in order to have this: s3client.setS3ClientOptions(S3ClientOptions.builder().
Read more >
java.lang.NoSuchMethodError: org.apache.http.conn.scheme ...
with the first step, initializing a HttpClient. This is my code: public class TestCase { public static void main(String[] args) throws MalformedURLException {...
Read more >
java.lang.NoSuchMethodError: org.apache.http.conn.ssl ...
Hi, As part of our project we have a requirement of placing our case attachments in the Amazon S3 server. With proper credentials...
Read more >
SSLConnectionSocketFactory (Apache HttpClient 4.5.12 API)
org.apache.http.conn.ssl ... SSLSocketFactory can be used to validate the identity of the HTTPS server against a ... Methods inherited from class java.lang.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found