From: Marc G. <mgu...@ya...> - 2014-08-14 15:00:43
|
Hi, this is surely a classpath issue. In your list, httpcore-4.3.jar doesn't look correct. You can download HtmlUnit with all it's dependencies or use for instance Maven to be sure to have the right versions of the different libraries. Cheers, Marc. -- HtmlUnit support & consulting from the source Blog: http://mguillem.wordpress.com Le 02/08/2014 01:16, Bill Taylor a écrit : > 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 |