[JVM] Tests in error: 'java.lang.NoSuchMethodError...'

3,536 views
Skip to first unread message

Tatyana Shapiro

unread,
May 29, 2013, 8:16:12 PM5/29/13
to cu...@googlegroups.com
Hi,

I have run my test in eclipse and got a new errort. Can you please give some points how to debug it?

java.lang.NoSuchMethodError: org.junit.runner.Description.createSuiteDescription(Ljava/lang/String;Ljava/io/Serializable;[Ljava/lang/annotation/Annotation;)Lorg/junit/runner/Description;
at cucumber.runtime.junit.FeatureRunner.getDescription(FeatureRunner.java:43)
at cucumber.api.junit.Cucumber.describeChild(Cucumber.java:72)
at cucumber.api.junit.Cucumber.describeChild(Cucumber.java:37)
at org.junit.runners.ParentRunner.getDescription(ParentRunner.java:290)
at org.junit.runner.Runner.testCount(Runner.java:38)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.countTestCases(JUnit4TestClassReference.java:30)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.countTests(RemoteTestRunner.java:487)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:455)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


This a list of my dependencies just in case: 
 <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.1.2</version>
<scope>test</scope>
    </dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.1.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.32.0</version>
</dependency>
  <dependency>
  <groupId>info.cukes</groupId>
  <artifactId>cucumber-jvm</artifactId>
  <version>1.1.2</version>
  <type>pom</type>
  </dependency>
  <dependency>
  <groupId>info.cukes</groupId>
  <artifactId>cucumber-picocontainer</artifactId>
  <version>1.1.3</version>
  </dependency>
  </dependencies>

I have reported another problem a few days https://groups.google.com/forum/?fromgroups=#!topic/cukes/aP4LB69U2lY it could be related,

thanks!

aslak hellesoy

unread,
May 29, 2013, 8:41:24 PM5/29/13
to Cucumber Users
On Wed, May 29, 2013 at 7:16 PM, Tatyana Shapiro <taty...@gmail.com> wrote:
Hi,

I have run my test in eclipse and got a new errort. Can you please give some points how to debug it?


Please use the same version for all cucumber-* libs as I have told you previously. Also: remove info.cukes:cucumber-jvm from your pom.

Can you put the output of `mvn dependency:tree` in a gist please? (https://gist.github.com)

 

--
-- Rules --
 
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
 
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gerard Maas

unread,
Sep 2, 2014, 7:55:40 AM9/2/14
to cu...@googlegroups.com


On Thursday, May 30, 2013 2:41:24 AM UTC+2, Aslak Hellesøy wrote:

On Wed, May 29, 2013 at 7:16 PM, Tatyana Shapiro <taty...@gmail.com> wrote:
Hi,

I have run my test in eclipse and got a new errort. Can you please give some points how to debug it?


Please use the same version for all cucumber-* libs as I have told you previously. Also: remove info.cukes:cucumber-jvm from your pom.

Can you put the output of `mvn dependency:tree` in a gist please? (https://gist.github.com)


Regarding this issue on :java.lang.NoSuchMethodError: org.junit.runner.Description.createSuiteDescription(Ljava/lang/String;Ljava/io/Serializable;[Ljava/lang/annotation/Annotation;)Lorg/junit/runner/Description;"  did you find a solution?
We are getting the same thing and all our config seems OK. We have other projects running fine but this one is giving us a headache.

Our cukes related pom content:
(Currently using cucumber version 1.1.5, junit 4.11)

<!-- TEST -->
        <dependency>
            <groupId>org.scalacheck</groupId>
            <artifactId>scalacheck_${scala.version.short}</artifactId>
            <version>${scalacheck.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${scala.version.short}</artifactId>
            <version>${scalatest.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- cukes -->
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-core</artifactId>
            <version>${cucumber.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-scala_2.10</artifactId>
            <version>${cucumber.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>${cucumber.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Junit -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
 
Thanks,

Gerard.

aslak hellesoy

unread,
Sep 2, 2014, 8:02:19 AM9/2/14
to Cucumber Users
On Tue, Sep 2, 2014 at 12:55 PM, Gerard Maas <gerar...@gmail.com> wrote:


On Thursday, May 30, 2013 2:41:24 AM UTC+2, Aslak Hellesøy wrote:

On Wed, May 29, 2013 at 7:16 PM, Tatyana Shapiro <taty...@gmail.com> wrote:
Hi,

I have run my test in eclipse and got a new errort. Can you please give some points how to debug it?


Please use the same version for all cucumber-* libs as I have told you previously. Also: remove info.cukes:cucumber-jvm from your pom.

Can you put the output of `mvn dependency:tree` in a gist please? (https://gist.github.com)


Regarding this issue on :java.lang.NoSuchMethodError: org.junit.runner.Description.createSuiteDescription(Ljava/lang/String;Ljava/io/Serializable;[Ljava/lang/annotation/Annotation;)Lorg/junit/runner/Description;"  did you find a solution?

If you run `mvn dependency:tree` you'll probably see that you have an older junit on your classpath that is shadowing 4.11. Older versions don't have the createSuiteDescription method you're getting an error about.

Aslak
 

---
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gerard Maas

unread,
Sep 2, 2014, 8:16:23 AM9/2/14
to cu...@googlegroups.com
Regarding this issue on :java.lang.NoSuchMethodError: org.junit.runner.Description.createSuiteDescription(Ljava/lang/String;Ljava/io/Serializable;[Ljava/lang/annotation/Annotation;)Lorg/junit/runner/Description;"  did you find a solution?

If you run `mvn dependency:tree` you'll probably see that you have an older junit on your classpath that is shadowing 4.11. Older versions don't have the createSuiteDescription method you're getting an error about.

Hi Aslak,

Thanks for the hint. That was the first thing that came to mind, but there's no junit 3.x creeping in the dependencies. I ran the build with mvn -X and the classpath of surefire only has 4.11 dependencies.
After wiping off my local m2 repo, I see that junit 3.8.1 is downloaded by a plugin, but I don't know how it's getting into the test build context.
For the record, the dep tree:

Any other hint? Or it *must* be a some junit 3.x sneaking into our build somehow??

Thanks,   Gerard. 
PS: Sorry for the piggy-back: Where can I find the release notes for a given release? I want to see what's in 1.1.8 to see how urgent we need to upgrade.

aslak hellesoy

unread,
Sep 2, 2014, 8:47:09 AM9/2/14
to Cucumber Users
On Tue, Sep 2, 2014 at 1:16 PM, Gerard Maas <gerar...@gmail.com> wrote:
Regarding this issue on :java.lang.NoSuchMethodError: org.junit.runner.Description.createSuiteDescription(Ljava/lang/String;Ljava/io/Serializable;[Ljava/lang/annotation/Annotation;)Lorg/junit/runner/Description;"  did you find a solution?

If you run `mvn dependency:tree` you'll probably see that you have an older junit on your classpath that is shadowing 4.11. Older versions don't have the createSuiteDescription method you're getting an error about.

Hi Aslak,

Thanks for the hint. That was the first thing that came to mind, but there's no junit 3.x creeping in the dependencies. I ran the build with mvn -X and the classpath of surefire only has 4.11 dependencies.
After wiping off my local m2 repo, I see that junit 3.8.1 is downloaded by a plugin, but I don't know how it's getting into the test build context.
For the record, the dep tree:

Any other hint? Or it *must* be a some junit 3.x sneaking into our build somehow??


Not necessarily 3.x. Even 4.10 won't work. I patched JUnit to make it work with Cucumber-JVM:
The fix went into the 4.11 release.

If you run with mvn -X you should see what's on the classpath.

Thanks,   Gerard. 
PS: Sorry for the piggy-back: Where can I find the release notes for a given release?

I want to see what's in 1.1.8 to see how urgent we need to upgrade.

Gerard Maas

unread,
Sep 2, 2014, 12:47:12 PM9/2/14
to cu...@googlegroups.com


On Tuesday, September 2, 2014 2:47:09 PM UTC+2, Aslak Hellesøy wrote:
On Tue, Sep 2, 2014 at 1:16 PM, Gerard Maas <gerar...@gmail.com> wrote:
Regarding this issue on :java.lang.NoSuchMethodError: org.junit.runner.Description.createSuiteDescription(Ljava/lang/String;Ljava/io/Serializable;[Ljava/lang/annotation/Annotation;)Lorg/junit/runner/Description;"  did you find a solution?

If you run `mvn dependency:tree` you'll probably see that you have an older junit on your classpath that is shadowing 4.11. Older versions don't have the createSuiteDescription method you're getting an error about.


Not necessarily 3.x. Even 4.10 won't work. I patched JUnit to make it work with Cucumber-JVM:
The fix went into the 4.11 release.

Hi Aslak,

Thanks for the advice. Using it, we manage to find the issue. 
For future reference: It was a shaded jar (uberjar)  from a  home-cooked  spark assembly that had an older version of junit. Being a uber-jar, all dependencies are 'melted' so it didn't show in the classpath or dependency tree.  Note for future self: Beware of such uber-beasts.

-kr, Gerard.


 

Himanshu Paliwal

unread,
May 11, 2018, 7:58:19 AM5/11/18
to Cukes
Hi Aslak,

I am using junit-4.12.jar but still getting same error.

Could you please help?

aslak hellesoy

unread,
May 11, 2018, 8:00:22 AM5/11/18
to Cucumber Users
What's the output of `mvn dependency:tree`?

To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages