Wednesday, February 4, 2015

java.lang.NoSuchMethodError: org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runLeaf(Lorg/junit/runners/model/Statement;Lorg/junit/runner/Description;Lorg/junit/runner/notification/RunNotifier;)V

You can encounter the following error:

java.lang.NoSuchMethodError: org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runLeaf(Lorg/junit/runners/model/Statement;Lorg/junit/runner/Description;Lorg/junit/runner/notification/RunNotifier;)V

In my case, I've got 2 JUnit dependencies with two different versions:

junit-4.7
junit-4.12

log4jdbc-remix has a JUnit dependency as compile scope,

so I excluded it as follows:

    compile("org.lazyluke:log4jdbc-remix:0.2.7") {
        exclude module: 'junit'
    }

No comments:

Post a Comment