Discussion:
[Cucumber] [cucumber-jvm][junit] java.lang.NoSuchFieldError: BEFORE_CLASS
(too old to reply)
DA Bears
2017-12-15 22:29:42 UTC
Permalink
Raw Message
Hi,
I am seeing following error when running test. Any clue what might be
the issue?

Cucumber version: 1.2.4
Spring version: 4.2.9

java.lang.NoSuchFieldError: BEFORE_CLASS

at
org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener.beforeTestClass(DirtiesContextBeforeModesTestExecutionListener.java:77)
at
org.springframework.test.context.TestContextManager.beforeTestClass(TestContextManager.java:179)
at
cucumber.runtime.java.spring.SpringFactory.notifyContextManagerAboutTestClassStarted(SpringFactory.java:138)
at cucumber.runtime.java.spring.SpringFactory.start(SpringFactory.java:108)
at cucumber.runtime.java.JavaBackend.buildWorld(JavaBackend.java:123)
at cucumber.runtime.Runtime.buildBackendWorlds(Runtime.java:140)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:38)
at
cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:93)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at cucumber.api.junit.Cucumber.run(Cucumber.java:98)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at
com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
MP Korstanje
2017-12-16 16:08:54 UTC
Permalink
Raw Message
Bit hard to tell from just the stack trace. I would guess this is caused by using incompatible versions of cucumber-spring and spring.

The project currently only supports a single version of spring. You can fix this by implementing the ObjectFactory for your specific version of spring.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
DA Bears
2017-12-18 13:55:22 UTC
Permalink
Raw Message
Thanks. I will give it a try
Post by MP Korstanje
Bit hard to tell from just the stack trace. I would guess this is caused
by using incompatible versions of cucumber-spring and spring.
The project currently only supports a single version of spring. You can
fix this by implementing the ObjectFactory for your specific version of
spring.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
DA Bears
2017-12-18 13:58:47 UTC
Permalink
Raw Message
I just checked the cucumber-spring in depedency:tree of my project. I do
not see any spring dependencies being pulled from cucumber-spring.

[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
info.cukes:cucumber-core:jar:1.2.4:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - | +-
info.cukes:cucumber-html:jar:0.2.3:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - | \-
info.cukes:cucumber-jvm-deps:jar:1.0.5:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
info.cukes:cucumber-java:jar:1.2.4:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
info.cukes:cucumber-junit:jar:1.2.4:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - | \-
junit:junit:jar:4.11:test
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
info.cukes:cucumber-spring:jar:1.2.4:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
org.slf4j:slf4j-api:jar:1.6.1:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
org.slf4j:jcl-over-slf4j:jar:1.6.1:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
ch.qos.logback:com.springsource.ch.qos.logback.core:jar:0.9.28:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
ch.qos.logback:com.springsource.ch.qos.logback.classic:jar:0.9.28:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - | \-
org.slf4j:com.springsource.slf4j.api:jar:1.6.1:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - \-
junit:junit:jar:cmeosgi:4.11:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - \-
org.hamcrest:hamcrest-core:jar:1.3:compile
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
------------------------------------------------------------------------
Post by DA Bears
Thanks. I will give it a try
Post by MP Korstanje
Bit hard to tell from just the stack trace. I would guess this is caused
by using incompatible versions of cucumber-spring and spring.
The project currently only supports a single version of spring. You can
fix this by implementing the ObjectFactory for your specific version of
spring.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Björn Rasmusson
2017-12-18 17:21:36 UTC
Permalink
Raw Message
Post by DA Bears
I just checked the cucumber-spring in depedency:tree of my project. I do
not see any spring dependencies being pulled from cucumber-spring.
Cucumber-JVM v1.2.4 specifies the spring version as 4.1.6-RELEASE
<https://github.com/cucumber/cucumber-jvm/blob/v1.2.4/pom.xml#L30>.
Post by DA Bears
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
info.cukes:cucumber-core:jar:1.2.4:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - | +-
info.cukes:cucumber-html:jar:0.2.3:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - | \-
info.cukes:cucumber-jvm-deps:jar:1.0.5:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
info.cukes:cucumber-java:jar:1.2.4:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
info.cukes:cucumber-junit:jar:1.2.4:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - | \-
junit:junit:jar:4.11:test
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
info.cukes:cucumber-spring:jar:1.2.4:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
org.slf4j:slf4j-api:jar:1.6.1:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
org.slf4j:jcl-over-slf4j:jar:1.6.1:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
ch.qos.logback:com.springsource.ch.qos.logback.core:jar:0.9.28:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - +-
ch.qos.logback:com.springsource.ch.qos.logback.classic:jar:0.9.28:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - | \-
org.slf4j:com.springsource.slf4j.api:jar:1.6.1:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - \-
junit:junit:jar:cmeosgi:4.11:compile
[main] INFO org.apache.maven.plugin.dependency.tree.TreeMojo - \-
org.hamcrest:hamcrest-core:jar:1.3:compile
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
------------------------------------------------------------------------
Post by DA Bears
Thanks. I will give it a try
Post by MP Korstanje
Bit hard to tell from just the stack trace. I would guess this is caused
by using incompatible versions of cucumber-spring and spring.
The project currently only supports a single version of spring. You can
fix this by implementing the ObjectFactory for your specific version of
spring.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
DA Bears
2017-12-18 15:45:59 UTC
Permalink
Raw Message
Is there any examples of implementing our own ObjectFactory?
Post by MP Korstanje
Bit hard to tell from just the stack trace. I would guess this is caused
by using incompatible versions of cucumber-spring and spring.
The project currently only supports a single version of spring. You can
fix this by implementing the ObjectFactory for your specific version of
spring.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...