Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: Exception in thread "main" java.lang.NoClassDefFoundError: dev/failsafe/Policy #14567

Open
36Tushar opened this issue Oct 6, 2024 · 5 comments

Comments

@36Tushar
Copy link

36Tushar commented Oct 6, 2024

What happened?

I am using Eclipse -> Maven with Selenium version 4.25.0 . I have almost tried every solution present on github , youtube and chatgpt still not able to resolve the issue .

i have tried to run my code even after adding dev.failsafe dependency ->

<dependency>
            <groupId>dev.failsafe</groupId>
            <artifactId>failsafe</artifactId>
            <version>3.3.0</version>
</dependency>

still facing the same issue.

here is my pom file ->
pom file .docx

How can we reproduce the issue?

{ public static void main(String[] args) {
		
		System.setProperty("webdriver.chrome.driver", "\"/Users/tusharyadav/Documents/chromedriver\"");
		var driver = new ChromeDriver();
		driver.get("https://www.google.com");
}

}

Relevant log output

Exception in thread "main" java.lang.NoClassDefFoundError: dev/failsafe/Policy
	at org.seleniumhq.selenium.http/org.openqa.selenium.remote.http.ClientConfig.<clinit>(ClientConfig.java:33)
	at org.seleniumhq.selenium.chrome_driver/org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:84)
	at org.seleniumhq.selenium.chrome_driver/org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:52)
	at introduction/introduction.Chrome.main(Chrome.java:10)
Caused by: java.lang.ClassNotFoundException: dev.failsafe.Policy
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	... 4 more

Operating System

macOS Sonoma 14.0

Selenium version

Maven 4.0.0 , selenium-java 4.25.0

What are the browser(s) and version(s) where you see this issue?

Chrome Version 129.0.6668.90 (Official Build) (arm64)

What are the browser driver(s) and version(s) where you see this issue?

chrome driver -129.0.6668.89

Are you using Selenium Grid?

no

Copy link

github-actions bot commented Oct 6, 2024

@36Tushar, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@joerg1985
Copy link
Member

joerg1985 commented Oct 7, 2024

@36Tushar you should remove the duplicate selenium-java and testng entries from your pom.xml. Alter this run mvn dependency:tree to check all selenium jars are from the same release version.

@36Tushar
Copy link
Author

36Tushar commented Oct 8, 2024

I have removed and checked versions and all selenium jars are from same release versions .

pom 2.docx

@joerg1985
Copy link
Member

@36Tushar could you share the output of mvn dependency:tree as txt file?

@36Tushar
Copy link
Author

pom file.txt

Here is my pom file

output.txt

Here is my output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants