question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[🐛 Bug]: Different io.netty (dependency) versions conflict in Selenium 4.5.0 with Java Module System

See original GitHub issue

What happened?

Error occurred during initialization of boot layer java.lang.module.ResolutionException: Modules io.netty.transport.epoll and io.netty.transport.classes.epoll export package io.netty.channel.epoll to module org.seleniumhq.selenium.chrome_driver

How can we reproduce the issue?

Require a project uses Java modules system.
Use java 16 or higher (m.b. not necessary).
Create maven project with 
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.5.0</version>
</dependency>
and simple entry point like

public static void main(String[] args) {
    System.setProperty("webdriver.chrome.driver", "chromedriver.exe");
    ChromeDriver driver = new ChromeDriver();
}

add module-info.java with requires org.seleniumhq.selenium.chrome_driver;
e.g.
module foo.bug.report {
    requires org.seleniumhq.selenium.chrome_driver;
}

Relevant log output

Error occurred during initialization of boot layer
java.lang.module.ResolutionException: Modules io.netty.transport.epoll and io.netty.transport.classes.epoll export package io.netty.channel.epoll to module org.seleniumhq.selenium.chrome_driver

Using maven dependency analyze command mvn dependency:tree -Dincludes=*netty*:

foo.bug.report:selenium-bug-report:jar:1.0
[INFO] \- org.seleniumhq.selenium:selenium-java:jar:4.5.0:compile
[INFO]    \- org.seleniumhq.selenium:selenium-remote-driver:jar:4.5.0:compile
[INFO]       +- io.netty:netty-buffer:jar:4.1.79.Final:compile
[INFO]       +- io.netty:netty-codec-http:jar:4.1.79.Final:compile
[INFO]       |  +- io.netty:netty-codec:jar:4.1.79.Final:compile
[INFO]       |  \- io.netty:netty-handler:jar:4.1.79.Final:compile
[INFO]       +- io.netty:netty-common:jar:4.1.79.Final:compile
[INFO]       +- io.netty:netty-transport-classes-epoll:jar:4.1.79.Final:compile
[INFO]       +- io.netty:netty-transport-classes-kqueue:jar:4.1.79.Final:compile
[INFO]       +- io.netty:netty-transport-native-epoll:jar:4.1.79.Final:linux-x86_64
[INFO]       +- io.netty:netty-transport-native-kqueue:jar:4.1.79.Final:osx-x86_64
[INFO]       +- io.netty:netty-transport-native-unix-common:jar:4.1.79.Final:compile
[INFO]       +- io.netty:netty-transport:jar:4.1.79.Final:compile
[INFO]       |  \- io.netty:netty-resolver:jar:4.1.79.Final:compile
[INFO]       \- org.asynchttpclient:async-http-client:jar:2.12.3:compile
[INFO]          +- io.netty:netty-codec-socks:jar:4.1.60.Final:compile
[INFO]          +- io.netty:netty-handler-proxy:jar:4.1.60.Final:compile
[INFO]          +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.60.Final:compile
[INFO]          +- io.netty:netty-transport-native-kqueue:jar:osx-x86_64:4.1.60.Final:compile
[INFO]          \- com.typesafe.netty:netty-reactive-streams:jar:2.0.4:compile

we can see, that there are 2 io.netty version in selenium dependencies: 4.1.79 and 4.1.60 (which causes bug).

Operating System

Windows 10

Selenium version

4.5.0

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

Chrome 106

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

Chromedriver 106

Are you using Selenium Grid?

No

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pujaganicommented, Oct 27, 2022

I understand your point. The jar packaging is mainly done by bazel and I am not sure how much of that we control. I don’t understand much on that front, but I will take a look to see if it is a simple fix. But again cannot promise to invest a lot of time into it since our long-term goal is only to support Java 11 client. I understand the issue persists currently with it because of how things are packaged but when async-http-client is no longer used then it will go away.

0reactions
github-actions[bot]commented, Dec 2, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IllegalAccessError with Selenium 4.5.0 when attempting to run ...
Steps to reproduce Require Java 17, latest version Require a multi module Java project For example, create a Java module, called module-a.
Read more >
How to debug dependency conflicts in Maven and Gradle
Errors like “NoSuchMethod” clearly indicate that you have some mismatching versions of dependencies. In this case, dependency selenium-chrome*.
Read more >
The selenium-java 4 dependency library version is not applied ...
I suspect a library conflict, so I did some tests. But I can't find the conflict in case. I created a new empty...
Read more >
Maven/mvn warnings - It is highly recommended to fix these ...
You have two warnings. The first warns you that you have the same dependency declared twice, but with different versions. When you are...
Read more >
What Is New In Selenium 4 And What Is Deprecated In It?
This Selenium WebDriver Tutorial for beginners and professionals will help you learn what's new in Selenium 4 (Features and Improvements).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found