Selenium: java.lang.IllegalAccessError: tried to access method com.google.common.util.concurrent.SimpleTimeLimiter.(Ljava/util/concurrent/ExecutorService;)V from class org.openqa.selenium.net.UrlChecker

Created on 11 Jul 2018  路  9Comments  路  Source: SeleniumHQ/selenium

java.lang.IllegalAccessError: tried to access method com.google.common.util.concurrent.SimpleTimeLimiter.(Ljava/util/concurrent/ExecutorService;)V from class org.openqa.selenium.net.UrlChecker

code snippet:

public class FirstSeleniumTest {

WebDriver driver = null;
String baseURL = "https://mail.google.com/";

@BeforeMethod
public void setup() throws InterruptedException {
    String currentDir = System.getProperty("user.dir");
    System.setProperty("webdriver.chrome.driver", currentDir + "\\executabledrivers\\chromedriver.exe");
    driver = new ChromeDriver();
    driver.get(baseURL);
    Thread.sleep(4000);
}

@Test
public void seleniumTest1() throws InterruptedException {
    System.out.println("seleniumTest1");
    driver.findElement(By.id("identifierId")).sendKeys("testautomation");

    Thread.sleep(2000);

}

@AfterMethod
public void tearDown() {
    driver.close();
    driver.quit();
}

}

OS: Windows

Browser: Chrome

Browser Version: 66.0.3359.181 (Official Build) (64-bit)

Expected Behavior - Chrome browser has to be launched

Actual Behavior - Getting exception: java.lang.IllegalAccessError: tried to access method com.google.common.util.concurrent.SimpleTimeLimiter.(Ljava/util/concurrent/ExecutorService;)V from class org.openqa.selenium.net.UrlChecker

Steps to reproduce -

Execute above script

R-awaiting answer

Most helpful comment

Caused when your version of selenium is too old and guava is too new. guava > 22.0 will generate this error. Either downgrade to guava.22.0 or upgrade selenium.

See here
https://github.com/SeleniumHQ/selenium/issues/4381

All 9 comments

What Selenium version do you use? Show your classpath settings, what versions of dependencies do you have in the classpath.

Selenium version: 3.13.0

This is how my classpath looks like:






















































































































































































@srinivasgoud-n: You comment looks incomplete.

You have

    <classpathentry exported="true" kind="lib" path="lib/selenium-java-2.53.1.jar"/>

in the classpath that causes collisions.

Also

    <classpathentry exported="true" kind="lib" path="lib/client-combined-3.8.1.jar"/>

Never include multiple versions of the same library to the classpath!

removed above two entries from classpath. still facing same issue..

This is a question rather than an issue. Or al least it's not a Selenium issue but your project misconfiguration. Please send questions to the selenium user group

Caused when your version of selenium is too old and guava is too new. guava > 22.0 will generate this error. Either downgrade to guava.22.0 or upgrade selenium.

See here
https://github.com/SeleniumHQ/selenium/issues/4381

Was this page helpful?
0 / 5 - 0 ratings