From: Ahmed A. <asa...@ya...> - 2015-11-09 05:58:22
|
Hi, You need to remove the direct HttpClient dependency, because it is already referenced by HtmlUnit by a newer version. <dependency> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId> <version>3.1</version> </dependency>You can see the used versions in eclipse.Ahmed From: Mn Kishore <ma...@gm...> To: Htm...@li... Sent: Sunday, November 8, 2015 10:08 AM Subject: [Htmlunit-user] issue in using Htmlunit with Maven dependency 0 down vote favorite I have added Htmlunit Maven dependency by adding the following to my pom.xml<dependency> <groupId>net.sourceforge.htmlunit</groupId> <artifactId>htmlunit</artifactId> <version>2.18</version> </dependency> When I am trying to run the application, I am getting the following error:Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/conn/ssl/NoopHostnameVerifier at com.gargoylesoftware.htmlunit.httpclient.HtmlUnitSSLConnectionSocketFactory.buildSSLSocketFactory(HtmlUnitSSLConnectionSocketFactory.java:112) at com.gargoylesoftware.htmlunit.HttpWebConnection.configureHttpsScheme(HttpWebConnection.java:597) at com.gargoylesoftware.htmlunit.HttpWebConnection.createHttpClient(HttpWebConnection.java:532) at com.gargoylesoftware.htmlunit.HttpWebConnection.getHttpClientBuilder(HttpWebConnection.java:494) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:158) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1321) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1238) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:346) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:415) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:400)The following is my complete pom.xml: |