0

I have created an exe with launch4j that does with the help of Selenium and Webdrivermanager some webautomation. For this I created a small Java Runtime Engine. To create it I used jdeps to get all required dependencies: jdeps -s file.jar. But as you can see one has been not found and I think this causes my problem:

com.google.gson -> jdk8internals
com.google.gson -> java.base
com.google.gson -> java.logging
com.google.gson -> java.sql
com.google.gson -> java.xml
com.google.gson -> not found

I created my JRE (Version 17.0.1) via: jlink --add-modules jdk.internal.ed,jdk.internal.jvmstat,jdk.internal.le,jdk.internal.opt,jdk.internal.vm.ci,jdk.internal.vm.compiler,jdk.internal.vm.compiler.management,java.base,java.sql --compress=2 --output jre

The Error I get in my error file is as follows:

error  is: io.github.bonigarcia.wdm.config.WebDriverManagerException: io.github.bonigarcia.wdm.config.WebDriverManagerException: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

All code I have for Webdrivemanager is:

public static void startDriver(String preferredBrowser) throws Exception{
    WebDriverManager.chromedriver().cachePath(driversPath).avoidOutputTree().setup();
    ChromeOptions options = new ChromeOptions();
    options.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
    options.setExperimentalOption("useAutomationExtension", false);

    driver = new ChromeDriver(options);

    JavascriptExecutor js = (JavascriptExecutor) driver;  
    js.executeScript("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})");
    driver.get(visitingWebsite);
}

If I let it run via my JDK it does work so the problem is for 100% my JRE and a missing module for Webdrivemanager. But I don't know why jdeps can't find it.

I hope you can help me out.

Best Regards

Christian

Muddyblack k
  • 314
  • 3
  • 16
  • This exception is thrown from SSL library and can mean anything like missing or invalid certificate or truststore, incompatible TLS version or unsupported ciphersuites, e.t.c.. If you can set the Java option -Djavax.net.debug=all you get a SSL debug output wich helps to analyze the problem. – Stefan D. Jan 02 '22 at 15:54
  • But it does work if I add all modules to my JRE with jlink so it must be a module that is missing. I can't set the option for my exe. It is the only file using JRE the rest uses my JDK – Muddyblack k Jan 02 '22 at 16:34

0 Answers0