[QMoney][Module 3]: Not able to load and run JUnit tests, getting NoClassDefFoundError

Getting NoClassDefFoundError while trying to run JUnit tests,
java.lang.NoClassDefFoundError: org/junit/platform/engine/EngineDiscoveryListener

Please refer to the screenshot for more info on the error:

Could mean several different things:

  1. You have not terminated the braces correctly during a merge resulting in the class not found.
  2. Any pending merge issues causing Java not to recognize the class as it is supposed to.

How did this suddenly happen? Did you just do a git merge? Can you check if you have done it right - else rollback and redo the merge.

Hey @sridherj, I did a merge at the beginning of milestone 1, that is during the setup. Initially I had hit the git mergetool command which resulted in some additional files which I deleted later manually, revert back to previous commit and then pulled the files again.

Is the only option left is to again hard reset to previous commit and do the pull and merge again?

@sridherj I reverted back to the previous commit by doing a hard reset but still the same error I see while trying to run the tests. Although I am able to build successfully using command line commands.

Good that you tried from terminal:
Are you saying ./gradlew test is working fine for you?

Yes, ./gradlew test is running fine but I am not able to use the debugger

Reset your workspace once and wait for java things to load

@gouravsardana tried that as well, still getting same error

Any update on this ? I haven’t been able to figure out the solution for this yet after having tried all the above suggestions.

updating junit-jupiter-api to 5.6.0 solved the issue

1 Like

Closing this topic as it has been solved by you yourself. Great job, keep working hard. if its not resolved feel free to un-mark the accepted solution to re-open the topic.