gpt4 book ai didi

java - lang.NoClassDefFoundError : org/apache/http/impl/conn/PoolingClientConnectionManager htmlunit. HttpWebConnection.createHttpClient

转载 作者:太空宇宙 更新时间:2023-11-04 12:09:40 25 4
gpt4 key购买 nike

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();

但是当我想初始化 headless Selenium 驱动程序而不是 Chrome 驱动程序时,代码失败:

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

最佳答案

org.apache.http.impl.conn.PoolingClientConnectionManager

不可用...您在某处有图书馆吗?

关于java - lang.NoClassDefFoundError : org/apache/http/impl/conn/PoolingClientConnectionManager htmlunit. HttpWebConnection.createHttpClient,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39973222/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com