bonigarcia/webdrivermanager

Problems unpacking geckodriver on Mac/Linux

reder9 opened this issue · 2 comments

Description of the problem: When the web driver manager goes to untar the geckodriver.tar.gz file on mac and linux systems the following exception is getting thrown:
java.lang.NoSuchMethodError: 'org.apache.commons.compress.archivers.tar.TarArchiveEntry org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry()'

This is seen with version 5.8.0 of the webdriver manager but if I roll back to an earlier version of say 5.5.2 it works for us.

Browser and version:
Firefox Browser

Operating system and architecture: Mac and Ubuntu

Selenium version:
4.20.0

WebDriverManager version:
5.8.0 fails, but 5.5.2 works.

WebDriverManager call:

final WebDriverManager firefoxManager = WebDriverManager.firefoxdriver();
						driverVersion.ifPresent(version -> firefoxManager.config().setFirefoxVersion(version));
						firefoxManager.setup();
						return Result.success();

Following the stacktrace down its coming from this line here: https://github.com/bonigarcia/webdrivermanager/blob/master/src/main/java/io/github/bonigarcia/wdm/online/Downloader.java#L280

Which I see changed about 7 months ago because that method became deprecated, when I roll back to an earlier version before that method change (say 5.5.2) then it works so seems like this line is the culrpit.

Error log:

java.lang.NoSuchMethodError: 'org.apache.commons.compress.archivers.tar.TarArchiveEntry org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry()'

I believe this problem is caused by a wrong version of the org.apache.commons:commons-compress library in your classpath. The version of this dependency in WebDriverManager 5.8.0 should be 1.26.1. Please double check you are using that version in your project, since otherwise, the java.lang.NoSuchMethodError might happen.

Ah yeah you are exactly right @bonigarcia, it looks like we are getting commons-compress-1.18.jar getting pulled in as a dependency from elsewhere so thats our problem. After getting that updated to a later version that has the TarArchiveEntry method its working, thank you!