Skip to content

[Bug]: [Java] Error stopping ChromeDriverService #16109

@wisty

Description

@wisty

Description

linux Error stopping ChromeDriverService
�[0;39m - 【WL-Task-4f413e15-92dd-4af8-9cfc-d311d93e2c59】Error stopping ChromeDriverService java.lang.RuntimeException: java.lang.InterruptedException at org.openqa.selenium.net.UrlChecker.waitUntilUnavailable(UrlChecker.java:153) at org.openqa.selenium.remote.service.DriverService.stop(DriverService.java:300) at org.dromara.wisdom.ma.spider.weblink.WebLinkSpiderTask.safeStop(WebLinkSpiderTask.java:473) at org.dromara.wisdom.ma.spider.weblink.WebLinkSpiderTask.checkCompletion(WebLinkSpiderTask.java:200) at org.dromara.wisdom.ma.spider.weblink.WebLinkSpiderTask.processTask(WebLinkSpiderTask.java:179) at org.dromara.wisdom.ma.spider.weblink.WebLinkSpiderTask.lambda$processSingleLink$3(WebLinkSpiderTask.java:385) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: java.lang.InterruptedException: null at java.base/java.util.concurrent.FutureTask.awaitDone(FutureTask.java:418) at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:203) at org.openqa.selenium.net.UrlChecker.waitUntilUnavailable(UrlChecker.java:141) ... 8 common frames omitted

Have you considered any alternatives or workarounds?

` private void initializeDriverPool() {
for (int i = 0; i < maxThreads; i++) {
driverPool.add(createNewDriver());
}
}

private WebDriver createNewDriver() {
    ChromeOptions options = new ChromeOptions();
    options.addArguments("--headless", "--disable-gpu", "--no-sandbox", "--disable-dev-shm-usage", "--disable-blink-features=AutomationControlled", "--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36");
    options.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
    Map<String, Object> prefs = new HashMap<>();
    prefs.put("profile.managed_default_content_settings.javascript", 2);  // 禁用 JS
    prefs.put("profile.managed_default_content_settings.stylesheet", 2);  // 禁用 CSS
    options.setExperimentalOption("prefs", prefs);
    WebDriver driver = new ChromeDriver(driverService, options);
    driver.manage().timeouts().pageLoadTimeout(timeoutSeconds, TimeUnit.SECONDS);
    return driver;
}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!C-javaJava BindingsJ-loggingApplied to issues where logging information would help troubleshoot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions