[🐛 Bug]: Regression in selenium 4.1.2 with NoSuchMethodError on ImmutableMap.of
See original GitHub issueWhat happened?
Upon updating from Selenium 4.1.1 to 4.1.2 I got this stacktrace with
java.lang.NoSuchMethodError: 'com.google.common.collect.ImmutableMap com.google.common.collect.ImmutableMap.of(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)'
at org.openqa.selenium.chrome.AddHasCasting.getAdditionalCommands(AddHasCasting.java:38)
Reverting back to 4.1.1 fixes the issue. ImmutableMap.of()
can only take 5 arguments, here it asks for 10. (EDIT: of
can take 10 args, but AddHasCasting.java ask for 12)
Someone else also noticed the same thing, see https://stackoverflow.com/a/70969932/13365 (last part)
How can we reproduce the issue?
This is a huge project, so I haven't got a snippet yet.
Relevant log output
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [no.example.config.ModuleTestConfig$$EnhancerBySpringCGLIB$$9a335649]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: 'com.google.common.collect.ImmutableMap com.google.common.collect.ImmutableMap.of(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)'
at app//org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:224)
at app//org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
at app//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1326)
... 101 more
Caused by: java.lang.NoSuchMethodError: 'com.google.common.collect.ImmutableMap com.google.common.collect.ImmutableMap.of(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)'
at org.openqa.selenium.chrome.AddHasCasting.getAdditionalCommands(AddHasCasting.java:38)
at org.openqa.selenium.chrome.ChromeDriver$ChromeDriverCommandExecutor.getExtraCommands(ChromeDriver.java:123)
at org.openqa.selenium.chrome.ChromeDriver$ChromeDriverCommandExecutor.<init>(ChromeDriver.java:118)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:106)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:93)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:82)
at no.example.webdriver.WebDriverSelector.createChromeDriver(WebDriverSelector.kt:137)
at no.example.webdriver.WebDriverSelector.createWebDriverFor(WebDriverSelector.kt:142)
at no.example.webdriver.WebDriverSelector.getDriver(WebDriverSelector.kt:95)
at no.example.config.LmsModuleTestConfig.<init>(ModuleTestConfig.java:26)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:211)
... 103 more
Operating System
macOS 12.1, Ubuntu 20.04
Selenium version
Java 4.1.2
What are the browser(s) and version(s) where you see this issue?
ChromeDriver 83.0.4103.14
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 83.0.4103.14
Are you using Selenium Grid?
No
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
java.lang.NoSuchMethodError: 'com.google.common.collect ...
The issue comes from conflicting Guava (transitive dependency) versions. It should be fixed with the WebDriverManager version 5.1.0.
Read more >How To Fix java.lang.NoSuchMethodError:org ... - YouTube
NoSuchMethodError : org.testng.TestRunner.addListener(Ljava/lang/Object;)V issue. ... Selenium Realtime Videos With Quick Solutions ...
Read more >Error when running script Exception in thread main java lang ...
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.ImmutableMap; at java.base/jdk.internal.loader.BuiltinClassLoader.
Read more >Immutable Map in Java - GeeksforGeeks
ImmutableMap, as suggested by the name, is a type of Map which is immutable. It means that the content of the map are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@diemol Wow, I must be blind. Thanks for your patience! I was fooled by the comment above, I guess:
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.