Skip to content

java.lang.IllegalArgumentException: Error: test loader org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader not found #1816

Description

@rbyjoswald

I get the above exception in the Debug Console when trying to run unit tests. To be honest, I'm lost as to why.

redhat.java: 1.49.0
vscjava.vscode-java-test: 0.43.2
VS Code: 1.106.2

Full Stack:

java.lang.IllegalArgumentException: Error: test loader org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader not found:
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
NativeConstructorAccessorImpl.java:77
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
DelegatingConstructorAccessorImpl.java:45
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
Constructor.java:500
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
Constructor.java:481
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createRawTestLoader(RemoteTestRunner.java:372)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createLoader(RemoteTestRunner.java:367)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.defaultInit(RemoteTestRunner.java:311)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.init(RemoteTestRunner.java:226)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Caused by: java.lang.NoSuchMethodError: 'void org.junit.platform.commons.util.CollectionUtils.forEachInReverseOrder(java.util.List, java.util.function.Consumer)'
	at org.junit.platform.launcher.core.LauncherConfigurationParameters$Builder.build(LauncherConfigurationParameters.java:143)
	at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:129)
	at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:112)
	at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.<init>(JUnit5TestLoader.java:37)
	... 10 more

	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createRawTestLoader(RemoteTestRunner.java:377)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createLoader(RemoteTestRunner.java:367)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.defaultInit(RemoteTestRunner.java:311)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.init(RemoteTestRunner.java:226)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)

Test related configs from build.gradle:

	testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3'
	testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
	testImplementation('org.springframework.boot:spring-boot-starter-test') {
		exclude group: 'junit', module: 'junit'
	}
	testCompile "org.mockito:mockito-core:2.+"
	testCompileOnly 'junit:junit:4.13.2'
	testCompileOnly 'org.projectlombok:lombok'
	testAnnotationProcessor 'org.projectlombok:lombok'

Any idea what could be the culprit? Thx!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions