java.lang.NoSuchMethodError: org.apache.http.conn.ssl.SSLSocketFactory.<init>(Ljavax/net/ssl/SSLContext;Lorg/apache/http/conn/ssl/X509HostnameVerifier;)
See original GitHub issueI’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:
- Created 9 years ago
- Comments:10
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You’re on a pretty old version of WireMock there. Have you tried the latest? HTTPClient has been upgraded recently.
Hi,
we still have the very same issue when running with latest wiremock and robolectric