java.lang.NoSuchMethodError: com.google.common.base.Preconditions

0

I have the following error:

java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:339)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)

I'm doing a bot for social networks, and I'm using Selenium libraries, the bot works perfectly in a Java Application, but when I copy the code to a Web Application where I have a Servlet listening to my Android application, when I run the Servlet and this calls the code of the bot used by Selenium, it throws the error above in this line of code:

System.setProperty("webdriver.chrome.driver", "C:\Users\manue\OneDrive\Escritorio\chromedriver.exe");
    driver = new ChromeDriver();

I have read that it could be due to the version of guava, but my version of guava is completely updated and I do not know why I may be generating this error.

In my maven pom.xml I have the following dependencies, among them those of Selenium that includes the latest version of guava.

    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>7.0</version>
        <scope>provided</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.10.0</version>
    </dependency>

I leave a screenshot of the structure of my project in case it helps.

    
asked by Manuel Moreno 14.03.2018 в 13:18
source

0 answers