question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incompatible class change error

See original GitHub issue

Summary

Tried to run a test after upgrading from Cucumber 2.1.0 to 3.0.2

Expected Behavior

Test runs successfully

Current Behavior

The following exception is thrown:

Exception in thread "main" java.lang.IncompatibleClassChangeError: Found interface cucumber.api.TestCase, but class was expected
	at org.jetbrains.plugins.cucumber.java.run.CucumberJvm2SMFormatter.handleTestCaseStarted(CucumberJvm2SMFormatter.java:80)
	at org.jetbrains.plugins.cucumber.java.run.CucumberJvm2SMFormatter.access$000(CucumberJvm2SMFormatter.java:17)
	at org.jetbrains.plugins.cucumber.java.run.CucumberJvm2SMFormatter$1.receive(CucumberJvm2SMFormatter.java:32)
	at org.jetbrains.plugins.cucumber.java.run.CucumberJvm2SMFormatter$1.receive(CucumberJvm2SMFormatter.java:30)
	at cucumber.runner.EventBus.send(EventBus.java:28)
	at cucumber.runner.TestCase.run(TestCase.java:37)
	at cucumber.runner.Runner.runPickle(Runner.java:44)
	at cucumber.runtime.Runtime.runFeature(Runtime.java:120)
	at cucumber.runtime.Runtime.run(Runtime.java:106)
	at cucumber.api.cli.Main.run(Main.java:35)
	at cucumber.api.cli.Main.main(Main.java:18)

Possible causes

Here are some of the versions of the dependencies for the project. Maybe related?

        <spring.version>4.3.7.RELEASE</spring.version>
        <cucumber.version>3.0.2</cucumber.version>
        <junit.version>4.12</junit.version>
        <selenium.version>3.7.1</selenium.version>

Environment

Mac OS X IntelliJIDEA

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

11reactions
mpkorstanjecommented, Jun 11, 2018

This is caused by IDEA’s CucumberJvm2SMFormatter. It being the formatter for Cucumber2, runs into a breaking change in Cucumber 3.

image

If you remove --plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm2SMFormatter from program arguments in the run configuration it will work again. You’ll have to do this until InteliJ fixes their plugin.

0reactions
mlvandijkcommented, Feb 8, 2019

@RajaRaviTeja But to give a hint: Note that you are using both Junit and TestNG dependencies, and the testng dependency is a different version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What causes java.lang.IncompatibleClassChangeError?
This means that you have made some incompatible binary changes to the library without recompiling the client code. Java Language Specification §13 details ......
Read more >
IncompatibleClassChangeError (Java Platform SE 7 )
Thrown when an incompatible class change has occurred to some class definition. The definition of some class, on which the currently executing method ......
Read more >
How to resolve Incompatible Class Change Error - Examples ...
IncompatibleClassChangeError is thrown when the programmer: ... Normally, the compiler would fail to compile the class when one of these occurs, ...
Read more >
Java Exception Handling - IncompatibleClassChangeError
A look into the Java IncompatibleClassChangeError, with code samples showing how binary incompatibilities may be unintentionally created.
Read more >
[Solved] java.lang.IncompatibleClassChangeError
This error is due to an incompatible version of cglib with additional jar files in your project, such as asm. Random exceptions. Solution....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found