From: Marc G. <mgu...@ya...> - 2005-08-19 08:38:09
|
Looks like you've got the wrong httpclient lib on your classpath. Are your sure to have only the jars of htmlunit's lib dir and no other version of httpclient on your classpath? Marc. Romain Thouvenin wrote: > 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 > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |