From: Ahmed A. <asa...@ya...> - 2014-08-02 05:12:13
|
Hi, This is a classpath issue. You may have different/incompatible HttpClient library version(s). You can use maven, which automatically handles all dependencies, or use only the jars with HtmlUnit distribution. Ahmed ________________________________ From: Bill Taylor <wat...@al...> To: htm...@li... Sent: Saturday, August 2, 2014 1:16 AM Subject: [Htmlunit-user] I am getting a No Such Method error when I call new WebClient(); The error is: Exception in thread "main" java.lang.NoSuchMethodError: org.apache.http.impl.cookie.BrowserCompatSpecFactory.create(Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/cookie/CookieSpec; at com.gargoylesoftware.htmlunit.CookieManager.<init>(CookieManager.java:54) at com.gargoylesoftware.htmlunit.WebClient.<init>(WebClient.java:136) at com.gargoylesoftware.htmlunit.WebClient.<init>(WebClient.java:199) at asst.htmlUnit.RenderJavaScriptMain.main(RenderJavaScriptMain.java:21) Line 21 of my main program is: WebClient webClient = new WebClient(); I have had a lot of trouble instantiating a WebClient because of Class Not Found errors. I ended up downloading several extra .jar files to get the program to get this far. The .jar files I am using are: batik-ext-1.6-1.jar commons-codec-1.9.jar commons-collections-3.2.1.jar commons-io-2.4.jar commons-lang3-3.3.2.jar commons-logging-1.1.3.jar cssparser-0.9.14.jar htmlunit-2.15.jar htmlunit-core-js-2.15.jar httpclient-4.3.3.jar httpcore-4.3.jar httpmime-4.3.3.jar jetty-websocket-8.1.15.v20140411.jar nekohtml-1.9.21.jar xalan-2.7.1.jar xercesImpl-2.11.0.jar xml-apis-1.4.01.jar I am running in Eclipse Version: Kepler Service Release 2 Build id: 20140224-0627 The JDK is 1.7. Thanks for your input. Bill Taylor ------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |