Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No backends were found. Please make sure you have a backend module on your CLASSPATH. #2212

Closed
kekekeke8 opened this issue Oct 19, 2024 · 1 comment

Comments

@kekekeke8
Copy link

πŸ‘“ What did you see?

Testing started at 11:37 ...
10月 19, 2024 11:37:17 上午 cucumber.api.cli.Main run
θ­¦ε‘Š: You are using deprecated Main class. Please use io.cucumber.core.cli.Main
10月 19, 2024 11:37:18 上午 io.cucumber.core.runtime.CucumberExecutionContext getRunner
δΈ₯重: Unable to start Cucumber
io.cucumber.core.exception.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH.
at io.cucumber.core.runtime.BackendServiceLoader.get(BackendServiceLoader.java:39)
at io.cucumber.core.runtime.BackendServiceLoader.get(BackendServiceLoader.java:33)
at io.cucumber.core.runtime.SingletonRunnerSupplier.createRunner(SingletonRunnerSupplier.java:45)
at io.cucumber.core.runtime.SingletonRunnerSupplier.get(SingletonRunnerSupplier.java:37)
at io.cucumber.core.runtime.CucumberExecutionContext.getRunner(CucumberExecutionContext.java:128)
at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:115)
at io.cucumber.core.runtime.Runtime.lambda$execute$6(Runtime.java:110)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at io.cucumber.core.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:233)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
at io.cucumber.core.runtime.Runtime.lambda$run$2(Runtime.java:86)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.stream.SliceOps$1$1.accept(SliceOps.java:200)
at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at io.cucumber.core.runtime.Runtime.run(Runtime.java:87)
at io.cucumber.core.cli.Main.run(Main.java:92)
at cucumber.api.cli.Main.run(Main.java:30)
at cucumber.api.cli.Main.main(Main.java:15)

10月 19, 2024 11:37:18 上午 io.cucumber.core.runtime.Runtime run
δΈ₯重: Exception while executing pickle
java.util.concurrent.ExecutionException: io.cucumber.core.exception.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH.
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at io.cucumber.core.runtime.Runtime.run(Runtime.java:93)
at io.cucumber.core.cli.Main.run(Main.java:92)
at cucumber.api.cli.Main.run(Main.java:30)
at cucumber.api.cli.Main.main(Main.java:15)
Caused by: io.cucumber.core.exception.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH.
at io.cucumber.core.runtime.BackendServiceLoader.get(BackendServiceLoader.java:39)
at io.cucumber.core.runtime.BackendServiceLoader.get(BackendServiceLoader.java:33)
at io.cucumber.core.runtime.SingletonRunnerSupplier.createRunner(SingletonRunnerSupplier.java:45)
at io.cucumber.core.runtime.SingletonRunnerSupplier.get(SingletonRunnerSupplier.java:37)
at io.cucumber.core.runtime.CucumberExecutionContext.getRunner(CucumberExecutionContext.java:128)
at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:115)
at io.cucumber.core.runtime.Runtime.lambda$execute$6(Runtime.java:110)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at io.cucumber.core.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:233)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
at io.cucumber.core.runtime.Runtime.lambda$run$2(Runtime.java:86)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.stream.SliceOps$1$1.accept(SliceOps.java:200)
at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at io.cucumber.core.runtime.Runtime.run(Runtime.java:87)
... 3 more

0 Scenarios
0 Steps
0m0.242s

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Share your Cucumber Report with your team at https://reports.cucumber.io β”‚
β”‚ Activate publishing with one of the following: β”‚
β”‚ β”‚
β”‚ src/test/resources/cucumber.properties: cucumber.publish.enabled=true β”‚
β”‚ src/test/resources/junit-platform.properties: cucumber.publish.enabled=true β”‚
β”‚ Environment variable: CUCUMBER_PUBLISH_ENABLED=true β”‚
β”‚ JUnit: @CucumberOptions(publish = true) β”‚
β”‚ β”‚
β”‚ More information at https://cucumber.io/docs/cucumber/environment-variables/ β”‚
β”‚ β”‚
β”‚ Disable this message with one of the following: β”‚
β”‚ β”‚
β”‚ src/test/resources/cucumber.properties: cucumber.publish.quiet=true β”‚
β”‚ src/test/resources/junit-platform.properties: cucumber.publish.quiet=true β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Exception in thread "main" io.cucumber.core.exception.CucumberException: io.cucumber.core.exception.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH.
at io.cucumber.core.runtime.CucumberExecutionContext.getException(CucumberExecutionContext.java:82)
at io.cucumber.core.runtime.Runtime.run(Runtime.java:103)
at io.cucumber.core.cli.Main.run(Main.java:92)
at cucumber.api.cli.Main.run(Main.java:30)
at cucumber.api.cli.Main.main(Main.java:15)
Caused by: io.cucumber.core.exception.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH.
at io.cucumber.core.runtime.BackendServiceLoader.get(BackendServiceLoader.java:39)
at io.cucumber.core.runtime.BackendServiceLoader.get(BackendServiceLoader.java:33)
at io.cucumber.core.runtime.SingletonRunnerSupplier.createRunner(SingletonRunnerSupplier.java:45)
at io.cucumber.core.runtime.SingletonRunnerSupplier.get(SingletonRunnerSupplier.java:37)
at io.cucumber.core.runtime.CucumberExecutionContext.getRunner(CucumberExecutionContext.java:128)
at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:115)
at io.cucumber.core.runtime.Runtime.lambda$execute$6(Runtime.java:110)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at io.cucumber.core.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:233)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
at io.cucumber.core.runtime.Runtime.lambda$run$2(Runtime.java:86)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.stream.SliceOps$1$1.accept(SliceOps.java:200)
at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at io.cucumber.core.runtime.Runtime.run(Runtime.java:87)
... 3 more

Process finished with exit code 1

βœ… What did you expect to see?

an example case can run correctly.

πŸ“¦ Which tool/library version are you using?


4.0.0

<groupId>automation-panda</groupId>
<artifactId>cucumber-jvm-java-example</artifactId>
<version>1.0-SNAPSHOT</version>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.7.0</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>4.25.0</version>
    </dependency>

    <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version> 3.8.0</version>
        <scope>test</scope>
    </dependency>


    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>6.11.0</version>
    </dependency>

    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>1.2.0</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>1.2.0</version>
    </dependency>
</dependencies>

πŸ”¬ How could we reproduce it?

No response

πŸ“š Any additional context?

No response

@mpkorstanje
Copy link
Contributor

mpkorstanje commented Oct 20, 2024

It looks like you are following a tutorial that uses an ancient version of Cucumber. And I guess you have tried to fix it by adding a more recent but still out of date module. That will not work, Cucumber expects all modules to have the same version.

To get started either use the skeleton project or follow the 10 minute tutorial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants