-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest version of jupiter causes JVM to not be able to start JUnit due to missing method #3933
Comments
Verify that the version of JUnit you are using is compatible with your
current JVM version. You might need to upgrade your JVM or downgrade JUnit
to a version that works.
or If you're using Maven or Gradle, ensure all dependencies are up to date
and that there are no version conflicts. Running mvn clean install or gradle
clean build might help resolve issues.
or Ensure your IDE is pointing to the correct JDK and that the build tools
are correctly configured to use the appropriate versions of dependencies.
Remember, Java is very sensitive to many things like compatibility and
specific letter cases. Check that too.
…On Fri, Aug 23, 2024 at 12:24 AM jimshowalter ***@***.***> wrote:
Tried upgrading to jupiter 5.11.0 as part of keeping all of our
dependencies current, but got this error:
org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could
not complete execution for Gradle Test Executor 10.
at
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:65)
at ***@***.***
/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at ***@***.***/java.lang.reflect.Method.invoke(Method.java:580)
at
org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at
org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at
org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
at
org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:92)
at jdk.proxy2/jdk.proxy2.$Proxy6.stop(Unknown Source)
at
org.gradle.api.internal.tasks.testing.worker.TestWorker$3.run(TestWorker.java:200)
at
org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:132)
at
org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:103)
at
org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:63)
at
org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
at
org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:121)
at
org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:71)
at
app//worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
at
app//worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
Caused by: org.junit.platform.commons.JUnitException: TestEngine with ID
'junit-jupiter' failed to discover tests
at
app//org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:160)
at
app//org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverSafely(EngineDiscoveryOrchestrator.java:132)
at
app//org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:107)
at
app//org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:78)
at
app//org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:99)
at
app//org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85)
at
app//org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47)
at
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:124)
at
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:99)
at
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:94)
at
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:63)
... 16 more
Caused by: org.junit.platform.commons.JUnitException: ClassSelector
[className =
'com.box.folder_operations.endpoint.v3.m1.FolderOperationsControllerTest',
classLoader = ***@***.***
resolution failed
at
app//org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener.selectorProcessed(AbortOnFailureLauncherDiscoveryListener.java:39)
at
app//org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:103)
at
app//org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:83)
at
app//org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:113)
at
app//org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:46)
at
app//org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:69)
at
app//org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:152)
... 26 more
Caused by: java.lang.NoSuchMethodError: 'boolean
org.junit.platform.commons.util.ReflectionUtils.returnsVoid(java.lang.reflect.Method)'
at
org.junit.jupiter.engine.discovery.predicates.IsTestableMethod.test(IsTestableMethod.java:48)
at
org.junit.jupiter.engine.discovery.predicates.IsTestMethod.test(IsTestMethod.java:23)
at
org.junit.jupiter.engine.discovery.predicates.IsTestableMethod.test(IsTestableMethod.java:26)
at java.base/java.util.function.Predicate.lambda$or$2(Predicate.java:101)
at java.base/java.util.function.Predicate.lambda$or$2(Predicate.java:101)
at
org.junit.platform.commons.util.ReflectionUtils.findMethod(ReflectionUtils.java:1559)
at
org.junit.platform.commons.util.ReflectionUtils.isMethodPresent(ReflectionUtils.java:1408)
at
org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.hasTestOrTestFactoryOrTestTemplateMethods(IsTestClassWithTests.java:50)
at
org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.test(IsTestClassWithTests.java:46)
at
org.junit.jupiter.engine.discovery.ClassSelectorResolver.resolve(ClassSelectorResolver.java:67)
at
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolve$2(EngineDiscoveryRequestResolution.java:135)
at
java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at
java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1685)
at
java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
at
java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
at
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
at
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at
java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
at
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at
java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647)
at
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:189)
at
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:126)
at
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:92)
... 31 more
We are using the latest Gradle (8.10), although it did this with 8.7 as
well (and we originally thought the Gradle upgrade was causing it).
Steps to reproduce
It's a little unclear how to reproduce this. We have some services that
blow up like this, and others that don't, and they're all using the same
versions of Gradle, Spring, Spring Boot, etc. We know you want a small
reproducible test case, but are hoping you'll take one look at that stack
and figure out what's going on.
It's likely there will be other reports of this in the next couple of
weeks. Perhaps one of those reports will include a small reproducible test
case.
—
Reply to this email directly, view it on GitHub
<#3933>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BKVTX4MKKYSQIWWCGNKDCW3ZSZJJHAVCNFSM6AAAAABM66S6Z2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4DCNZXGE4DGMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Do all services follow this or a similar guide https://junit.org/junit5/docs/current/user-guide/#running-tests-build-spring-boot to configure JUnit with Spring Boot? Those stacktraces usually show when there's a mixture of JUnit Platform and Jupiter libraries. |
@sormuras is correct.
That indicates that the version of the JUnit Jupiter Engine is not compatible with the version of the JUnit Platform Commons in the classpath. Thus, you'll need to sort out your dependencies by using the JUnit BOM or upgrading your JUnit dependencies appropriately. As @sormuras mentioned, we even have a dedicated section in the User Guide to address this: https://junit.org/junit5/docs/current/user-guide/#running-tests-build-spring-boot In light of the above, I am closing this issue. |
You might consider pinning one of these issues or adding something to the issue template, considering how many times such tickets are raised 🙂 |
All of our JUnit and Mockito dependencies are at the latest version. |
Actually not. It was platform commons after all. We've added a Gradle force directive to lock the version. |
Glad to hear you sorted that out. |
We'll investigate that in #3935. |
Tried upgrading to jupiter 5.11.0 as part of keeping all of our dependencies current, but got this error:
We are using the latest Gradle (8.10), although it did this with 8.7 as well (and we originally thought the Gradle upgrade was causing it).
Steps to reproduce
It's a little unclear how to reproduce this. We have some services that blow up like this, and others that don't, and they're all using the same versions of Gradle, Spring, Spring Boot, etc. We know you want a small reproducible test case, but are hoping you'll take one look at that stack and figure out what's going on.
It's likely there will be other reports of this in the next couple of weeks. Perhaps one of those reports will include a small reproducible test case.
The text was updated successfully, but these errors were encountered: