While using #RunWith(Cucumber.class) I am getting:
Cucumber cannot be resolved to type and class <Cucumber>cannot resolved to a type.
But no any suggestions to import library statement.
If I import it manually by using import cucumber.api.CucumberOptions then getting Cucumber.api cannot resolved to the type.
Is there any dependency or any external jars that needed to be added?
Have you added Cucumber as a dependency to your project? You can do so with Maven or Gradle.
For instance, if you are using Maven, you need to add the following dependency to your pom.xml:
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java8</artifactId>
<version>3.0.2</version>
<scope>test</scope>
</dependency>
Note that 3.0.2 is the current version atm. There will be new versions released. You can find the latest version either in the documentation or on GitHub.
You can find more information about installation here: https://docs.cucumber.io/installation/java/
Related
I am trying to use ScpCfHttpDestination from cloudplatform-connectivity-3.3.1.jar, but it does not seem to be available in versions from 3.0.0 to 3.3.1. Am I missing somehting?
You can find the class in dependency:
<dependency>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-connectivity-scp-cf</artifactId>
</dependency>
Or even better within (more generic, transitive) dependency:
<dependency>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>scp-cf</artifactId>
</dependency>
I would also suggest to create a new (temporary) project from the archetype to determine which dependencies work best for you.
I have a groovy application that uses groovy version 2.2.1. My groovy app was previously running fine but has recently started throwing this exception:
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at com.app.Main.main(Main.groovy:83)Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.typehandling.ShortTypeHandling
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
The ShortTypeHandling class was not even introduced until groovy 2.3.0. How can it be referenced in a groovy app running version 2.2.1? I can solve this problem by replacing the groovy-all-2.2.1.jar with groovy-all-2.3.0.jar in my pom but that doesn't root cause the issue.
ShortTypeHandling was introduced in groovy-all-2.3.0.jar so the quick fix was to replace the older groovy-all-x.x.x.jar with groovy-all-2.3.0.jar. This solved the runtime ShorTypeHandling ClassNotFoundException but also created new problems by introducing a new groovy-all.jar dependency in the application.
The real issue was how the groovy compiler was being invoked via maven. Because I introduced spock which required groovy 2.0, I needed to update the maven entries for the groovy-eclipse-compiler dependency. Here are the updated maven entries for working with groovy 2.x:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
<!-- Java version -->
<source>1.7</source>
<target>1.7</target>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.8.0-01</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<!-- Groovy version -->
<version>2.1.8-01</version>
</dependency>
</dependencies>
</plugin>
With this in place, I could leave my groovy-all dependency the way I originally had it for the working/fully tested application like this:
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<!-- If possible, its better if this matches 2.1.8 in the plugin definition -->
<!-- but 2.2.1 worked fine here and allowed me to keep the original pom definition -->
<version>2.2.1</version>
</dependency>
The application runtime no longer references the ShortTypeHandling class and everything worked as it previously did.
You have to add (If you are using Gradle)
compile 'org.codehaus.groovy:groovy-backports-compat23:2.4.5'
I've just had this after updating the groovy-eclipse Feature in Eclipse (in order to try and fix intermittent save issues caused by https://jira.codehaus.org/browse/GRECLIPSE-1519). Specifically in my case, my Groovy JUnit tests were throwing this exception.
In light of the suggestions above, I checked my Eclipse settings, and it was using Groovy 2.3.4.xx whereas my Maven POM was specifying 2.1.8.xx. I went to Window -> Preferences -> Groovy -> Compiler and clicked "Switch to 2.1.8.xx...", restarting Eclipse when prompted, and this fixed it.
I've solved this issue by adding this dependency on my POM:
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-backports-compat23</artifactId>
<version>2.4.5</version>
</dependency>
Then, it works like a charm.
Matthew Wise's solution worked for me, but in addition to restarting eclipse, I also had to do a project -> clean for it to recompile with the new compiler.
(I would have commented on his answer, but stack overflow has this stupid rule that you can't comment until you get more reputation)
I faced similar issue in our project. Surprisingly groovy version was not an issue.
I was building the project with older version of gradle than the expected gradle version for the project. That resolved the error.
Add following dependency to your pom.xml
<dependency>
<groupId>org.codehaus.groovy.maven.runtime</groupId>
<artifactId>gmaven-runtime-default</artifactId>
<version>1.0-rc-3</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
</exclusion>
</exclusions>
</dependency>
Kuldeep Singh
Can someone give me a link to download the cassandra-jbcd.1.2.3.jar ?
The most recent version I found is cassandra-jbcd.1.2.1.jar and i really need the last version of cassandra for my work.
Please help
Since it's not in their downloads you can build it yourself using the dependency. Create a maven project add the dependency, compile the project and maven will create the jar for you.
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>cassandra-clientutil</artifactId>
<version>1.2.3</version>
</dependency>
Here is an example build, but I dont think it will be very long before it's out of date again.
I tried to implement this example:
http://icefaces-showcase.icesoft.org/showcase.jsf?grp=aceMenu&exp=chartBean
I wanted to import the
org.icefaces.ace.model.chart.SectorSeries
class, it isn't in the jar file.
I use maven, and I added this dependency to the project's pom file
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces-ace</artifactId>
<version>3.0.1</version>
</dependency>
Could someone tell me what I do wrong?
I can't find anywhere the location of this class.
Please help me!
Thanks in advancd
I don't believe that class was not available until version 3.1.0 (not 3.0.1) so you'll need to upgrade your Maven poms to get that release.
I am studying JSF from Oracle online tutorial. While building its example "hello1" on netbeans it gives the following error at the line import javax.faces.bean.ManagedBean;:
package javax.faces.bean does not exist
How is this caused and how can I solve it?
Add these 2 dependency in your project's pom.xml file
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.7</version>
</dependency>
This will solve your dependency problem.
You have to add javax.faces.api jar file to your project.
You can find this library here.
After downloading this file, you have to import that into your project and add it to your artifact.
For gradle :
'com.sun.faces:jsf-api:2.2.8'
'com.sun.faces:jsf-impl:2.2.8'
If you use Netbeans you can search for the library javax.faces.jar in the same folder of this application, you may find it in a folder like this: C:\Program Files\NetBeans 7.3.1\enterprise\modules\ext\jsf-2_2.
Now, right click on yourProject/libraries in Netbeans then choose Add JAR/Folder... command to add javax.faces.jar file.
Adding javax.faces.jar library
From the same popup menu you can use Add Library and add Java EE from GlassFish
Adding Java EE from GlassFish library
Good luck.