0
java.lang.NoClassDefFoundError: gherkin/IGherkinDialectProvider
at cucumber.runtime.RuntimeOptionsFactory.create(RuntimeOptionsFactory.java:23)

I have used cucumber-java-4.2.0,cucumber-junit-4.2.0,cucumber-core-4.2.0,junit-4.12, and gherkin 2.1.12.

And, when used gherkin 5.1.0, getting below error"

java.lang.NoClassDefFoundError: 
io/cucumber/datatable/dependency/com/fasterxml/jackson/databind/JavaType
at io.cucumber.datatable.DataTableType.<init>(DataTableType.java:78)
at io.cucumber.datatable.DataTableTypeRegistry.<init> 
(DataTableTypeRegistry.java:27)
at io.cucumber.stepexpression.TypeRegistry.<init>(TypeRegistry.java:22)
at 
Hussain
  • 1
  • 3
  • Have a look at https://stackoverflow.com/questions/36771066/java-lang-noclassdeffounderror-exception-while-running-cucumber-test-using-junit . Mismatched versions might be an issue. – tryingToLearn Nov 01 '18 at 05:03
  • I have already tried those solutions But, didn't work for me.:( – Hussain Nov 01 '18 at 05:10
  • you just need to add dependency for junit 4.12, cucumber-junit 4.2.0, cucumber-java 4.2.0. gherkin etc are downloaded automatically as dependencies. Check the "Dependencies Heirarchy" tab for the POM if u are on eclipse – Grasshopper Nov 01 '18 at 05:25
  • Tried the above one: getting java.lang.NoClassDefFoundError: o/cucumber/datatable/dependency/com/fasterxml/jackson/databind/JavaType at io.cucumber.datatable.DataTableType.(DataTableType.java:78) at io.cucumber.datatable.DataTableTypeRegistry.\ – Hussain Nov 01 '18 at 05:32
  • Gherkin v5.1.0 is getting added to pom dependies. Is it causing the issue.. – Hussain Nov 01 '18 at 05:40
  • do u have the datatable 1.1.7 jar and datatable-dependencies 1.1.7 jar in the maven dependencies downloaded automatically? – Grasshopper Nov 01 '18 at 05:43
  • If not then delete the local repository "io.cucumber" and build project again. Else add the dependency explicitly to the pom - io.cucumber datatable 1.1.7 – Grasshopper Nov 01 '18 at 05:46
  • Yes. those got added to pom dependencies – Hussain Nov 01 '18 at 05:47
  • The "JavaType" class should be inside the datatable-dependencies 1.1.7 jar – Grasshopper Nov 01 '18 at 05:50
  • I deleted the repository and built it once again. Now, error is not coming but getting 0 Scenarios 0 Steps 0m0.132s even though i have scenario and step implementations..This is my feature file: Feature: Application Login Scenario Outline: Home Page Default Login. Given User is on NetBanking Landing Page When User login into application with username and password And clicks on submit buttton Then Home page is displayed – Hussain Nov 01 '18 at 05:51
  • Thanks @Grasshopper.. working for me after re-build of project. – Hussain Nov 01 '18 at 06:03

1 Answers1

0

This is due to the jar version too high, you can change a low version. such as change 4.3.1 to 4.0.0.

Anantha Raju C
  • 1,780
  • 12
  • 25
  • 35
Peter
  • 1