Reputation: 897
I have one application which needs to have httpclient-4.2.5.jar library to run correctly. I also want to use HtmlUnit library (ver. 2.12). It fails (I think) because of library conflicts (between httpclient-4.2.5.jar and htmlunit-2.12.jar)
Here is output from my log, but I do not understend too much what it says to me because I do not call any of this methods in log...
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: org.apache.http.conn.ssl.SSLSocketFactory.createDefaultSSLContext()
at com.gargoylesoftware.htmlunit.HtmlUnitSSLSocketFactory.createSSLContext(HtmlUnitSSLSocketFactory.java:119)
at com.gargoylesoftware.htmlunit.HtmlUnitSSLSocketFactory.<init>(HtmlUnitSSLSocketFactory.java:102)
at com.gargoylesoftware.htmlunit.HtmlUnitSSLSocketFactory.buildSSLSocketFactory(HtmlUnitSSLSocketFactory.java:77)
at com.gargoylesoftware.htmlunit.HttpWebConnection.configureHttpsScheme(HttpWebConnection.java:608)
at com.gargoylesoftware.htmlunit.HttpWebConnection.createHttpClient(HttpWebConnection.java:555)
at com.gargoylesoftware.htmlunit.HttpWebConnection.getHttpClient(HttpWebConnection.java:518)
at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:155)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1486)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1403)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:305)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:374)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:359)
Upvotes: 2
Views: 1656
Reputation: 3749
I had this problem because I wanted to use WebClient in Selenium.
I upgraded Selenium from 2.33.0 to 2.45.0 and WebClient worked fine afterwards.
Upvotes: 0
Reputation: 2194
promote the htmlunit version to 2.15 would fix the problem. worked for me
Upvotes: 2
Reputation: 27548
It is all very simple. HtmlUnit makes use of a private method in HttpClient code through refection:
The method in question was removed in version 4.2.4. See HTTPCLIENT-1320
Upvotes: 3
Reputation: 897
Well, the only solution which works for me is to downgrade to httpclient 4.2 - http://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient/4.2
Upvotes: 2
Reputation: 44
Quickly checked the "org.apache.http.conn.ssl.SSLSocketFactory" class documentation and there's no such "createDefaultSSLContext()" method there.
Upvotes: 0