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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悰 Bug]: Exception in thread "main" java.lang.NoClassDefFoundError: io/netty/util/Timer #14210

Open
zeus200003 opened this issue Jun 30, 2024 · 2 comments

Comments

@zeus200003
Copy link

What happened?

After adding all the files needed and changing the working env. to JRE 22 , new problem occurred which preventing selenium from starting

How can we reproduce the issue?

package samplePackage;

import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.*;

public class WebDriverDemo {

	public static void main(String[] args) {

		System.setProperty("webdriver.chrome.driver", "C:\\Users\\peter\\OneDrive\\Desktop\\Selenium Jars & Drivers\\Drivers\\chromedriver.exe");
		WebDriver driver = new ChromeDriver() ;
		driver.navigate().to("www.google.com");

	}

}

Relevant log output

Exception in thread "main" java.lang.NoClassDefFoundError: io/netty/util/Timer
	at org.openqa.selenium.remote.http.netty.NettyClient$Factory.createClient(NettyClient.java:135)
	at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:116)
	at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:94)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.<init>(DriverCommandExecutor.java:88)
	at org.openqa.selenium.chromium.ChromiumDriverCommandExecutor.<init>(ChromiumDriverCommandExecutor.java:40)
	at org.openqa.selenium.chrome.ChromeDriver$ChromeDriverCommandExecutor.<init>(ChromeDriver.java:111)
	at org.openqa.selenium.chrome.ChromeDriver.generateExecutor(ChromeDriver.java:101)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:88)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:84)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:52)
	at samplePackage.WebDriverDemo.main(WebDriverDemo.java:11)
Caused by: java.lang.ClassNotFoundException: io.netty.util.Timer
	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:525)
	... 11 more

Operating System

Windows 11

Selenium version

selenium-java-4.22.0

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

Chrome

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

Chrome Driver latest stable version available

Are you using Selenium Grid?

No response

Copy link

@zeus200003, 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!

@MHabiib
Copy link

MHabiib commented Jul 1, 2024

hi @zeus200003
Make sure your pom.xml file specifies <java.version>22</java.version> to ensure compatibility with Java 22. Also, correct the usage of driver.get() in your Selenium script by including the full URL with the protocol e.g., driver.get("http://www.google.com");.
These steps should resolve the issues you're encountering with Selenium not starting and ensure proper navigation in your WebDriver script.

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