Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)

suganthan sivananthan

I develop the selenium code that:

    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.chrome.ChromeDriver;
    import org.openqa.selenium.edge.EdgeDriver;
    import org.openqa.selenium.firefox.FirefoxDriver;
    import org.openqa.selenium.support.ui.Select;
    import java.util.List;

    public class TestDemoQA {
        public static void main(String[] args) throws InterruptedException{
            System.setProperty("webdriver.edge.driver", "C:\\Users\\Suganthan\\Downloads\\MicrosoftWebDriver.exe");
            WebDriver driver = new EdgeDriver();
            driver.get("http://demoqa.com/");
            driver.manage().window().maximize();`

I'm getting the error that is:

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)

I'm trying to solve this issue according to This Solution by upgrading guava-21.0. But I'm still getting this error. could anyone give a solution to solve it?

DebanjanB

This error message...

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)

...implies that the JVM was unable to initiate/spawn your program.

As @GhostCat pointed your main issue is the incompatibility between the guava version and other binary versions you are using.

Solution

  • Upgrade JDK to recent levels JDK 8u181.
  • Upgrade Selenium to current levels Version 3.14.0.
  • When you remove the previous version of Selenium Client ensure that all the associated jars are properly removed.
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • Execute your @Test.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Preconditions

From Dev

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

From Dev

NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;J)V

From Dev

Exception in thread "main" java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z

From Java

Fatal Exception: java.lang.NoSuchMethodError in com.google.android.gms.common.api.internal.BackgroundDetector.readCurrentStateIfPossible

From Dev

spark 1.4.0 java.lang.NoSuchMethodError: com.google.common.base.Stopwatch.elapsedMillis()J

From Dev

Getting Exception in thread "main" java.lang.VerifyError: class com.google.gwt.dev.HostedModeBase$ArgHandlerNoServerFlag

From Dev

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/gson/JsonParseExceptiong

From Java

Exception in thread "main" java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer

From Dev

Exception in thread "main" java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer

From Dev

Exception in thread "main" java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;

From Dev

java.lang.NoSuchMethodError: com.google.common.collect.FluentIterable.toList()Lcom/google/common/collect/ImmutableList;

From Dev

Exception in thread "main" java.lang.StackOverflowError

From Dev

Exception in thread "main" java.lang.IllegalMonitorStateException

From Dev

Exception in thread "main" java.lang.UnsupportedClassVersionError:

From Dev

Exception in thread "main" java.lang.IndexOutOfBoundsException:

From Dev

java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor

From Dev

java.lang.NoSuchMethodError: com.google.common.io.Files.asCharSink

From Dev

java.lang.NoSuchMethodError: com.google.common.collect.Sets.newConcurrentHashSet

From Dev

Selenium Remote Web Driver gives java.lang.NoSuchMethodError: com.google.common.collect.Multimaps.transformValues

From Dev

Spark 1.3.1 SQL Lib: Exception in thread "main" java.lang.NoSuchMethodError: org.apache.spark.sql.SQLContext.implicits()

From Dev

Exception in thread "main" java.lang.NoClassDefFoundError: Main$1 java?

From Dev

Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jersey/api/client/config/ClientConfig RestFul

From Dev

How to fix "Exception in thread "main" java.lang.NoClassDefFoundError: com/dropbox/core/json/JsonReader$FileLoadException"

From Dev

Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/datatype/jsr310/JavaTimeModule

From Dev

axet/desktop: Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jna/Platform

From Dev

How to fix Exception in thread "main" java.lang.NoClassDefFoundError: com/itextpdf/text/DocumentException

From Dev

NoSuchMethodError: com.google.common.base.Platform.systemNanoTime() In GWT project

From Dev

PDFbox Exception - Exception in thread "main" java.lang.VerifyError

Related Related

  1. 1

    Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Preconditions

  2. 2

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

  3. 3

    NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;J)V

  4. 4

    Exception in thread "main" java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z

  5. 5

    Fatal Exception: java.lang.NoSuchMethodError in com.google.android.gms.common.api.internal.BackgroundDetector.readCurrentStateIfPossible

  6. 6

    spark 1.4.0 java.lang.NoSuchMethodError: com.google.common.base.Stopwatch.elapsedMillis()J

  7. 7

    Getting Exception in thread "main" java.lang.VerifyError: class com.google.gwt.dev.HostedModeBase$ArgHandlerNoServerFlag

  8. 8

    Exception in thread "main" java.lang.NoClassDefFoundError: com/google/gson/JsonParseExceptiong

  9. 9

    Exception in thread "main" java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer

  10. 10

    Exception in thread "main" java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer

  11. 11

    Exception in thread "main" java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;

  12. 12

    java.lang.NoSuchMethodError: com.google.common.collect.FluentIterable.toList()Lcom/google/common/collect/ImmutableList;

  13. 13

    Exception in thread "main" java.lang.StackOverflowError

  14. 14

    Exception in thread "main" java.lang.IllegalMonitorStateException

  15. 15

    Exception in thread "main" java.lang.UnsupportedClassVersionError:

  16. 16

    Exception in thread "main" java.lang.IndexOutOfBoundsException:

  17. 17

    java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor

  18. 18

    java.lang.NoSuchMethodError: com.google.common.io.Files.asCharSink

  19. 19

    java.lang.NoSuchMethodError: com.google.common.collect.Sets.newConcurrentHashSet

  20. 20

    Selenium Remote Web Driver gives java.lang.NoSuchMethodError: com.google.common.collect.Multimaps.transformValues

  21. 21

    Spark 1.3.1 SQL Lib: Exception in thread "main" java.lang.NoSuchMethodError: org.apache.spark.sql.SQLContext.implicits()

  22. 22

    Exception in thread "main" java.lang.NoClassDefFoundError: Main$1 java?

  23. 23

    Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jersey/api/client/config/ClientConfig RestFul

  24. 24

    How to fix "Exception in thread "main" java.lang.NoClassDefFoundError: com/dropbox/core/json/JsonReader$FileLoadException"

  25. 25

    Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/datatype/jsr310/JavaTimeModule

  26. 26

    axet/desktop: Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jna/Platform

  27. 27

    How to fix Exception in thread "main" java.lang.NoClassDefFoundError: com/itextpdf/text/DocumentException

  28. 28

    NoSuchMethodError: com.google.common.base.Platform.systemNanoTime() In GWT project

  29. 29

    PDFbox Exception - Exception in thread "main" java.lang.VerifyError

HotTag

Archive