I am following this guide to build an application named [Entando][2].
Particularly I did the steps in 2.2 using the maven command to build the application
mvn archetype:generate -Dfilter=entando-archetype-webapp-generic
and it was successful.
Then to launch the application there is written to use the maven command
mvn clean jetty:run
At first I had the error described here but solved thanks to the answer there.
Now I am getting a similar error for javax.xml.ws:WebServiceContext:
I tried to modify the pom.xml file by adding:
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>WebServiceContext</artifactId>
<version>2.2.11</version>
</dependency>
but it did not work resulting in the error:
Could not find artifact javax.xml.ws:WebServiceContext:jar:1.1.1 in snapshot-repository (https://oss.sonatype.org/content/repositories/snapshots/)
How can I solve it?
I found a solution, I will share it in case someone will need it:
In the pom.xml I added:
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.2.6</version>
</dependency>
No need to add this javax.xml.ws dependency if you are using JDK 1.8 its rt.java already include this. If your JDK do not have rt.java ,just reconfigure it in your eclipse.
Add this dependency in your project-
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.2.6</version>
</dependency>
and mvn clean install
I am very new to Neo4j and I want to get started with an embedded Neo4j in a Java Application.
I try to create an HelloWorld Application like the following:
https://neo4j.com/docs/java-reference/current/#tutorials-java-embedded
You can find the source code here:
https://github.com/neo4j/neo4j/blob/3.1/manual/embedded-examples/src/main/java/org/neo4j/examples/EmbeddedNeo4j.java
I created a new maven project and added org.neo4j:neo4j 3.0.3 as a dependency. Unfortunately I cannot import "org.neo4j.graphdb.factory.GraphDatabaseFactory", all other imports seem to be ok.
Now I figured out, that the import is working for version "3.1.0-SNAPSHOT" of the neo4j dependency.
Here you can find the relevant part of my pom-file:
<dependencies>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>3.1.0-SNAPSHOT</version>
</dependency>
</dependencies>
Because I want to use a stable version, I want to achieve this with version 3.0.3 as well, but I cannot find something that this factory is depending on this version or how you should do it at version 3.0.3. Can somebody provide information about this?
The dependency you should include in your pom.xml is
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>3.0.3</version>
</dependency>
As I see you already included the right dependency. Then I guess something went wrong during the resolving. Therefore purge your local repository and resolve the dependency again with following command
mvn dependency:purge-local-repository -Dinclude=org.neo4j:neo4j
If it's still not working you have to check if you are resolving the artifact from the maven central repository or somewhere else.
I am developing my Selenium-JVM framework with Cucumber and while running my first feature got below error.
Please help.
How did I launch the feature -
Right click on feature file
Select Run As -> Cucumber Feature
Immediate Exception -
Exception in thread "main" cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH.
at cucumber.runtime.Runtime.<init>(Runtime.java:78)
at cucumber.runtime.Runtime.<init>(Runtime.java:67)
at cucumber.runtime.Runtime.<init>(Runtime.java:63)
at cucumber.api.cli.Main.run(Main.java:24)
at cucumber.api.cli.Main.main(Main.java:16)
What I have in code -
Launcher.java -
package cucumber;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
#RunWith(Cucumber.class)
#CucumberOptions(format={"pretty","json:target/"} , features="/src/test/java/cucumber/features")
public class Launcher {
}
Feature file -
Feature: it works demo
Scenario: First test
Given this is my step
When this is my second step
Then this is my final step
List of Dependencies added to list -
cucumber-core-1.1.8
cucumber-html-0.2.3
cucumber-java-1.1.8
cucumber-junit-1.1.8
cucumber-jvm-deps-1.0.3
gherkin-2.12.2
hamcrest-all-1.3
junit-4.11
selenium-api-2.42.2
selenium-firefox-driver-2.42.2
selenium-java-2.42.2
selenium-remote-driver-2.42.2
selenium-support-2.42.2
My JVM - 1.7
Only this much is available in project.
Please help.
Make sure you're adding below dependencies for Maven project:
You can replace version to the latest or the required version:
<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>
This error is thrown when no 'backends' are found on the classpath. There is a 'backend' for each supported language (e.g. cucumber-java, cucumber-groovy etc.)
It's probably a classpath error, although if cucumber-core and cucumber-java are in the same location that does seem strange.
Used the latest and same version for all dependencies and it works fine.
<dependencies>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-core</artifactId>
<version>6.11.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>6.11.0</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>6.11.0</version>
</dependency>
</dependencies>
You can try the cucumber-java-1.2.4 at https://mvnrepository.com/artifact/info.cukes/cucumber-java/1.2.4.
I found that trying a previous version of the same JAR file worked for me.
I guess this may solve for other people as well. In case it does not, please add another answer.
Let me know if it worked for you and saved some valuable time :-)
Writing in 2020, though enough discussion has already gone on this topic. Still if it helps someone. For me the issue got resolved with same version of
cucumber-java
cucumber-junit
cucumber-core
dependencies
snippet of my POM
io.cucumber
cucumber-java
6.4.0
io.cucumber
cucumber-core
6.4.0
io.cucumber
cucumber-junit
6.4.0
compile
You are not providing the path of the step definition class
Add glue in the cucumber options may be it will help.
#RunWith(Cucumber.class) #CucumberOptions(
features ="Path of the feature file",
glue = {"path of step definition class or package "},
format={"pretty","json:target/"},
dryRun = true,
strict = true,
monochrome = true )
I got this same error message when trying to run a Cucumber feature file in Eclipse.
These steps worked for me:
Updated my pom.xml file with the latest and same version of the following libraries.
cucumber-junit - 1.2.6
cucumber-java - 1.2.6
Also I updated 'junit' to the latest version
Here is the fix:
in eclipse projects add the following in the .project file
<buildSpec>
...
<buildCommand>
<name>cucumber.eclipse.steps.jdt.stepsBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
...
<nature>cucumber.eclipse.steps.jdt.stepsNature</nature>
</natures>
If this did not fix the issue,
add the dependency
cucumber-java
in the project classpath or change the version of the jar to latest or n-1
i had pom in my dependency for cucumber-java. Once i removed that worked fine
I have updated my pom.xml file with the latest version of following libraries. It works for me.
junit
cucumber-java
cucumber-junit
Make sure you are using the correct version of junit, cucumber-java, cucumber-junit. It should not be like you are using some older version of junit and latest versions of cucumber junit and java. I have list down the dependencies which I have used. You can try these.
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>6.7.0</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>6.7.0</version>
</dependency>
The error simply says that cucumber is not configured properly on your device.
This can be because of missing dependencies or the dependencies are not loaded properly.
Check for the dependencies first and then save all, close the editor, and then reopen it.
Try to run again and check.
Removed Cucumber Core dependency from POM.XML it is working fine
Commenting in 2021. This might help someone.
The issues is simple, cucumber groupid has been changed to >io.cucumber< so if you are still using >info cukes< you will be getting exceptions. That is why when you update your cucumber java to the latest it solves the issue bc the latest groupid comes as io.cucumber. You can as well change all the groupid info cukes in your pom.xml to io.cucumber. This will solve the issue
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-jvm-deps -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm-deps</artifactId>
<version>1.0.5</version>
<scope>provided</scope>
</dependency>
Keep only three tags (groupId, artifactId and version) in your dependencies. Delete <scope> and other additional tags in pom.xml and then try.
Errors on running Cucumber Feature
Exception in thread "main" cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH.
Solution
Most probably this means that your cucumber-java version and java version on your machine is not compatible with each other. First, check Java Version on your machine by going through this article How to check Java/JDK Version Installed on your Machine.
On my machine, I have Java 1.8.0 with cucumber-Java8-1.2.5 and it did not work. When I degraded my cucumber java version to cucumber-Java-1.2.5, it worked fine for me. Just make sure that first, you remove the cucumber-java which did not work for you from Project build path >> Libraries and then add new.
It can also be caused by having 2 backend: for example:
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>7.8.0</version>
<scope>test</scope>
</dependency>
and
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
</dependency>
Also make sure you have compatible versions
I encountered this same error message when trying to run a Cucumber feature file in Eclipse ("No backends were found. Please make sure you have a backend module on your CLASSPATH").
What fixed it for me was going into my pom.xml and changing the cucumber-java and cucumber-junit versions away from 1.2.5 (per their documentation) to 1.2.0.
I'm not 100% sure if I'm ignoring a real issue by doing this or not. Here is more information about my setup:
Windows 10
Eclipse Neon (4.6.0)
Apache Maven 3.5.0
Java 1.8
I verified via quick commands that java and maven are installed successfully and running on my machine. I also verified that Maven pulled in the cucumber-java, and cucumber-core jars in my Eclipse project. Odd.
Adding the following dependency I got resolved this issue
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>4.2.6</version>
</dependency>
I like to build (mvn clean install) the picketlink example on
https://github.com/picketlink/TODO
But it wont work because the dependency picketlink-extension 3.0.0 isnt available in any repository.
Can anyone give me a hint what im doing wrong?
You could try to change
<dependency>
<groupId>org.picketlink.extensions</groupId>
<artifactId>picketlink-extensions-core</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
to
<dependency>
<groupId>org.picketlink.extensions</groupId>
<artifactId>picketlink-extensions-core</artifactId>
<version>3.0.0-2013Feb08</version>
</dependency>
or anything newer from Maven Repository
I am new to Maven and am trying to set up one of my first POMs. My application will cache using EhCache. Going to Maven Central Repo (link here) I copy-n-pasted the <dependency> tag and copy it into my pom.xml like so:
...many dependencies above this point
<dependency>
<scope>compile</scope>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.0.1.Final</version>
</dependency>
<dependency>
<scope>compile</scope>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<scope>compile</scope>
<groupId>jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>3.5.3</version>
</dependency>
...many dependencies below this point
When I save the changes, Eclipse builds the workspace and gives me an error on the opening <dependency> tag for EhCache 2.5:
Missing artifact net.sf.ehcache:ehcache:jar:2.5.0
So I figured that perhaps v.2.5.0 has something wrong with it, and repeated the same for 2.4.7 (the last 2.4.x release before 2.5.0). Same deal.
Since I'm so new to Maven, I don't even know where to begin looking. I tried Project >> Clean and even restarted Eclipse to see if it was just a typical Eclipse "quirk". Nope.
I am thinking:
Could EhCache be publishing bad JARs to the Maven repo?
Could Maven Repo have something wrong with it?
Could this be due to something else configured wrong in my pom.xml?
Could this be a "JAR hell" issue where I have a conflict somewhere on my dependency graph?
How would SO start tackling this problem? Thanks in advance!
It is usually safer to refer to search.maven.org. Dependency from there:
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.5.0</version>
<type>pom</type>
</dependency>
Mind type pom. From module's pom:
This is a pom artifact to pull in ehcache-core and ehcache-terracotta
for clustering. Make sure to set 'type' to 'pom' in your dependency.
Aparently when someone does not need terracotta, ehcache-core will do perfectly fine as other answer states.
They use ehcache-core in the official documentation. Maven Central does not have a jar artifact for ehcache 2.5 which explains your error message.
Using ehcache-core changes the dependency to:
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>2.5.0</version>
</dependency>
Which successfully downloads on my machine (ehcache does not).
I dropped this into IntelliJ and it found it. I suspect there is something wrong with your settings. Try creating a project with only this dependency in it. If it fails to download, I would check your setting. e.g. .m2/settings.xml Are you using a Nexus server or maven proxy/cache?
BTW: A simpler way to search for JARs is to use http://mvnrepository.com/ which will find all the available versions and show you the XML you need to add.