Invalid or corrupt jar file when trying to start selenium server from intelliJ

P Jones picture P Jones · Apr 24, 2019 · Viewed 8.7k times · Source

I am trying to start my selenium server from intelliJ and it is saying the file is corrupt.

I use intelliJ to run my protractor tests, and when I starts the selenium server from the intelliJ terminal before I run them. For whatever reason it is saying my jar file for selenium-server-standalone is coming back as corrupt. Is there a way to fix this and, if not, is there a way to delete and then reinstall selenium server?

C:\Users\pheonix.jones\IdeaProjects\attensity-q-protractor>webdriver-manager start [11:39:09] I/start - java -Dwebdriver.chrome.driver=C:\Users\pheonix.jones\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.46.exe -Dwebdriver.gecko.driver=C:\Users\pheonix.jones\AppData\Roaming\npm\node_modules\pro tractor\node_modules\webdriver-manager\selenium\geckodriver-v0.24.0.exe -jar C:\Users\pheonix.jones\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\selenium-server-standalone-4.0.0-alpha-1.zip.jar -port 4444 [11:39:09] I/start - seleniumProcess.pid: 2748 Error: Invalid or corrupt jarfile C:\Users\pheonix.jones\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\selenium-server-standalone-4.0.0-alpha-1.zip.jar [11:39:09] I/start - Selenium Standalone has exited with code 1

As you can see, it is just exiting after it comes back as corrupt. I haven't had issues with this before. I did try to update the webdriver.

Answer

mamacdon picture mamacdon · Apr 24, 2019

I found a workaround, which may or may not be acceptable. You can force webdriver-manager to use an older version of the selenium-standalone package. This avoids whatever the problem is with 4.0.0-alpha-1.

$ webdriver-manager clean
$ webdriver-manager update --standalone --versions.standalone=3.8.0
$ webdriver-manager start --versions.standalone=3.8.0
…
[14:19:55] I/start - seleniumProcess.pid: 63863
14:19:55.379 INFO - Selenium build info: version: '3.8.0', revision: '924c4067df'
14:19:55.380 INFO - Launching a standalone Selenium Server
2019-04-24 14:19:55.483:INFO::main: Logging initialized @390ms to org.seleniumhq.jetty9.util.log.StdErrLog