Skip to content

selenium-java depends on org.apache.commons:commons-exec but does not declare it #3284

@dirkweinhardt

Description

@dirkweinhardt

Selenium Version: 2.53.1

org.openqa.selenium.os.UnixProcess imports and uses org.apache.commons.exec.DaemonExecutor which comes from org.apache.commons:commons-exec. selenium-java's pom.xml file does not declare a runtime dependency from org.apache.commons:commons-exec.

The Selenium parent pom.xml dependency management section lists org.apache.commons:commons-exec:1.3.

Attempting to run tests based on selenium-java results in below error if the project doesn't otherwise depend on org.apache.commons:commons-exec.

The issue can be worked around by declaring a dependency from org.apache.commons:commons-exec:1.3 in the pom.xml file of the project which also depends on selenium-java.

org.jbehave.core.failures.BeforeOrAfterFailed: Method beforeStory (annotated with @BeforeStory in class org.jbehave.web.selenium.PerStoryWebDriverSteps) failed: java.lang.NoClassDefFoundError: org/apache/commons/exec/DaemonExecutor
	at org.jbehave.core.steps.StepCreator$BeforeOrAfterStep.perform(StepCreator.java:460)
	at org.jbehave.core.embedder.StoryRunner$FineSoFar.run(StoryRunner.java:499)
        [...]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/exec/DaemonExecutor
	at org.openqa.selenium.os.UnixProcess.<init>(UnixProcess.java:52)
	at org.openqa.selenium.os.CommandLine.<init>(CommandLine.java:47)
	at org.openqa.selenium.firefox.FirefoxBinary.startProfile(FirefoxBinary.java:97)
	at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:100)
	at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:119)
        [...]
	at org.jbehave.core.steps.StepCreator$BeforeOrAfterStep.perform(StepCreator.java:458)
	... 12 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.exec.DaemonExecutor
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        [...]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	... 32 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions