public static void main(String[] args) throws IOException {
RbnRunner runner = new RbnRunner();
runner.run();
}
public void run() throws IOException {
System.setProperty("webdriver.chrome.driver", "/Users/me/samples/Adam_milford/src/chromedriver");
WebDriver driver = new ChromeDriver();
が、私は代わりにクロームドライバーのヘッドレスセレンドライバを初期化したい、コードfailes:lang.NoClassDefFoundError:ORG/apacheの/ HTTP/IMPL/CONN/PoolingClientConnectionManager htmlunit.HttpWebConnection.createHttpClient
public static void main(String[] args) throws IOException {
WebDriver driver = new HtmlUnitDriver();
なぜですか?
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/impl/conn/PoolingClientConnectionManager
at com.gargoylesoftware.htmlunit.HttpWebConnection.createHttpClient(HttpWebConnection.java:536)
at com.gargoylesoftware.htmlunit.HttpWebConnection.getHttpClient(HttpWebConnection.java:500)
at com.gargoylesoftware.htmlunit.HttpWebConnection.setUseInsecureSSL(HttpWebConnection.java:711)
at com.gargoylesoftware.htmlunit.WebClient.setUseInsecureSSL(WebClient.java:1096)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.createWebClient(HtmlUnitDriver.java:263)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.<init>(HtmlUnitDriver.java:129)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.<init>(HtmlUnitDriver.java:172)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.<init>(HtmlUnitDriver.java:168)
at RbnRunner.run(RbnRunner.java:40)
at RbnRunner.main(RbnRunner.java:28)
Caused by: java.lang.ClassNotFoundException: org.apache.http.impl.conn.PoolingClientConnectionManager
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 10 more
通常、実際の問題は「原因:」行に示されている問題です。 'ClassNotFoundException'です。いくつかの 'Cause By:'句がある場合、最後のものに注目してください。 – SJuan76