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.

STS 4.4.0 no longer runs JUnit5 Tests - STS 4.3.2 did not have a problem

See original GitHub issue

When I took STS 4.4.0 last Friday and ran my JUnit5 tests, I received this error:

java.lang.NoClassDefFoundError: org/junit/platform/commons/PreconditionViolationException
    at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.createUnfilteredTest(JUnit5TestLoader.java:75)
    at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.createTest(JUnit5TestLoader.java:66)
    at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.loadTests(JUnit5TestLoader.java:53)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:525)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
Caused by: java.lang.ClassNotFoundException: org.junit.platform.commons.PreconditionViolationException
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 7 more

The tests were working fine with version 4.3.2. The only non-base install plug-in I have is “EclEmma Java Code Coverage 3.1.2”, so I tried removing that from my install in 4.4.0 and that did not resolve the issue. When I downgraded back to 4.3.2, I was able to successfully run my tests again.

My basic STS install details for 4.3.2 are attached. STSInstallDetails.txt

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:27 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
mdehner-drivincommented, Jan 22, 2020

@martinlippert - I took Spring Tools release 4.5.1 today and have verified that the problem is no longer occurring. I’m not sure what the procedure is to close out an issue off your board(s). If I need to do the closing, could you let me know what I should do? Thanks very much.

1reaction
kdvoldercommented, Jan 16, 2020

Is there anyway I can debug this?

I’m not sure. If I had a project that triggers the bug I’d try poking at it in different ways until I figured something out, but it isn’t exactly a well-defined process.

But since its working for you now in latest nightly build I don’t think its worth spending a lot of effort on this. Whatever the problem was you ran into seems to be fixed and that’s what really matters.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Your JUnit 5 Tests Are Not Running Under Maven
There is a very common issue preventing your JUnit 5 tests from running under Maven. In this post, I explain why and provide...
Read more >
Eclipse No tests found using JUnit 5 caused by ...
I fixed the issue by right clicking the test and selecting 'Run Configurations' and changing the "Test runner:" selection to 'JUnit 4' as...
Read more >
JUnit 5 User Guide
Test classes, test methods, and lifecycle methods are not required to be public , but they must not be private . It is...
Read more >
JUnit 5 tutorial - Learn how to write unit tests - Vogella.com
This tutorial explains unit testing with JUnit with the JUnit 5 framework (JUnit Jupiter). It explains the creation of JUnit 5 tests with ......
Read more >
Why Your JUnit 5 Tests Are Not Running Under Maven - DZone
The root cause is likely your Maven version. Maven 3.6.0 was released on October 24th, 2018. This release includes version 2.22.0 of the...
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