From: Romain T. <tho...@ii...> - 2005-08-19 08:30:23
|
I wrote a very simple test to use HtmlUnit, but it fails at the first line. I don't understand what can be my error. Here is the code of the test : public class TestNavig{ public static void main(String[] args) { WebClient browser = new WebClient(); HtmlPage identPage = (HtmlPage) browser.getPage(new URL("http://localhost:8080/")); } } And the StackTrace of the thrown exception : java.lang.NoSuchMethodError: org.apache.commons.httpclient.HttpClient.getParams()Lorg/apache/commons/httpclient/params/HttpClientParams; at com.gargoylesoftware.htmlunit.HttpWebConnection.getHttpClientFor(HttpWebConnection.java:301) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:131) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1588) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1562) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:359) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:415) at com.sfwan.tester.tests.TestNavig.main(TestNavig.java:31) I'm using HtmlUnit-1.6 and all the jars provided in the lib directory of the zip I've downloaded are in my classpath. Does anybody understand wich mistake i've made ? Thanks, Romain |