gpt4 book ai didi

java - Webdriver:java.net.BindException:地址已在使用:连接

转载 作者:搜寻专家 更新时间:2023-10-30 21:26:09 26 4
gpt4 key购买 nike

在运行 webdriver 时,运行 3 分钟后,出现以下异常并且 Webdriver 崩溃。

我只使用一个 webdriver 实例和一个 FirefoxDriver 配置文件。

Exception in thread "main" org.openqa.selenium.WebDriverException:
java.net.BindException: Address already in use: connect
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
java.version: '1.6.0_18'
Driver info: driver.version: remote
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:
341)
at
org.openqa.selenium.firefox.FirefoxDriver.execute(FirefoxDriver.java:
234)
at
org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:
173)
at
org.openqa.selenium.remote.RemoteWebDriver.findElementsByXPath(RemoteWebDriver.java:
231)
at org.openqa.selenium.By$6.findElements(By.java:200)
at
org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:
158)

Caused by: java.net.BindException: Address already in use: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at
org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:
123)
at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:
133)
at
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:
149)
at
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:
108)
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:
415)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
641)
at
org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:
211)
at
org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.execute(NewProfileExtensionConnection.java:
125)
at org.openqa.selenium.firefox.FirefoxDriver
$LazyCommandExecutor.execute(FirefoxDriver.java:341)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:
328)
... 11 more

最佳答案

您的出站端口用完了。这意味着您在两分钟内执行了数千次出站连接。解决方案:使用连接池,或降低程序速度。

关于java - Webdriver:java.net.BindException:地址已在使用:连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4320397/

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