ChromeDriver and ChromeDriverService Do Not Work

The test server worked well, but when you try to deploy it to another server, it stops working at chromeDriverService = ChromeDriverService.createDefaultService(); even if you remove the ChromeDriverService and immediately use driver = new ChromeDriver(options); the code stops without executing it.

Both servers are the same except for the version and memory. Changing the size of the thread pool from 10 to 1 doesn’t work because I was wondering if it was a memory problem.

It stopped before it was initialized, so the log is not even taken.

Main Server – Rocky Linux release 8.10 (Green Obsidian)

              total        used        free      shared  buff/cache   available
Mem:          7.5Gi       5.5Gi       926Mi       178Mi       1.1Gi       1.6Gi
Swap:         2.0Gi       1.7Gi       303Mi

Test Server – Rocky Linux release 8.9 (Green Obsidian)

              total        used        free      shared  buff/cache   available
Mem:           15Gi       6.6Gi       2.4Gi       477Mi       6.4Gi       8.0Gi
Swap:         2.0Gi       843Mi       1.2Gi

I use Selenium Java 4.22.0, Chrome 126, ChromeDriver 126

@Log4j2
public class SeleniumCrawlerDriver implements AutoCloseable {

    private static final ChromeOptions chromeOptions = new ChromeOptions();
    private static final String CHROME_DRIVER = "webdriver.chrome.driver";

    private ChromeDriverService chromeDriverService;
    private WebDriver driver;

    public SeleniumCrawlerDriver() {
        System.setProperty(CHROME_DRIVER, getChromeDriverPath());
    }

    public boolean create() {

        ChromeOptions options = initChromeOptions();

        log.debug("chrome option init");

        chromeDriverService = ChromeDriverService.createDefaultService();
        log.debug("create ChromeDriverService");
////        chromeDriverService = new ChromeDriverService.Builder()
////                .usingDriverExecutable(new File(getChromeDriverPath()))
////                .usingAnyFreePort()
////                .withLogFile(new File(getChromeDriverLogPath(site.getLogName())))
////                .build();

        driver = new ChromeDriver(chromeDriverService, options);
//        driver = new ChromeDriver(options);
        driver.manage().timeouts().scriptTimeout(Duration.ofSeconds(30));
        driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30));
        driver.manage().timeouts().pageLoadTimeout(Duration.ofSeconds(30));

        return true;
    }

    private ChromeOptions initChromeOptions() {

        String downloadFilepath = getDownloadLocationPath();

        Map<String, Object> prefs = new HashMap<>();
        prefs.put("credentials_enable_service", false);
        prefs.put("profile.password_manager_enabled", false);
        prefs.put("download.prompt_for_download", false);
        prefs.put("download.default_directory", downloadFilepath);
        prefs.put("browser.set_download_behavior", "{behavior : 'allow' , downloadPath: '" + downloadFilepath + "'}");
//        chromeOptions.addArguments("--download.default_directory=/dev/null");
        chromeOptions.addArguments("--disable-infobars");
        chromeOptions.addArguments("--disable-notifications");
        chromeOptions.addArguments("--headless=new");
        chromeOptions.addArguments("--window-size=1920,1080");
        chromeOptions.addArguments("--disable-extensions");
        chromeOptions.addArguments("--proxy-server='direct://'");
        chromeOptions.addArguments("--proxy-bypass-list=*");
        chromeOptions.addArguments("--start-maximized");
        chromeOptions.addArguments("--disable-gpu");
        chromeOptions.addArguments("--disable-dev-shm-usage");
        chromeOptions.addArguments("--disable-logging");
        chromeOptions.addArguments("--log-level=2");
//        chromeOptions.addArguments("--disable-popup-blocking");
        chromeOptions.addArguments("--no-sandbox");
        chromeOptions.addArguments("--ignore-certificate-errors");
        chromeOptions.setExperimentalOption("prefs", prefs);
        chromeOptions.addArguments("start-maximized");
        chromeOptions.addArguments("enable-javascript");
        chromeOptions.addArguments("user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36");

        return chromeOptions;
    }

}

New contributor

Ahn Nayeong is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật