2
votes

I recently changed a couple of things in my Eclipse settings, mainly I upgraded the Java version from 8 to 15 and it took me a while to notice, but I cannot Test with Coverage anymore on any of my Projects as it throws a java.lang.instrument.IllegalClassFormatException with a gigantic StackTrace.

It also gives a PopUp Error, that says "No tests found with test runner 'Junit5'" Something, somewhere in the Java Librarys, Junit, or something must've broken, and I cannot figure out what it is. Normal Testing, Debug Testing and even Maven test all function normally with no indication of anything being wrong.

Here's the Junit Failure Trace:

java.util.ServiceConfigurationError: Locale provider adapter "CLDR"cannot be instantiated. at java.base/sun.util.locale.provider.LocaleProviderAdapter.forType(LocaleProviderAdapter.java:199) at java.base/sun.util.locale.provider.LocaleProviderAdapter.findAdapter(LocaleProviderAdapter.java:287) at java.base/sun.util.locale.provider.LocaleProviderAdapter.getAdapter(LocaleProviderAdapter.java:258) at java.base/java.text.DecimalFormatSymbols.getInstance(DecimalFormatSymbols.java:180) at java.base/java.util.Formatter.getZero(Formatter.java:2437) at java.base/java.util.Formatter.(Formatter.java:1956) at java.base/java.util.Formatter.(Formatter.java:1978) at java.base/java.lang.String.format(String.java:3292) at org.junit.runner.Description.formatDisplayName(Description.java:114) at org.junit.runner.Description.createTestDescription(Description.java:86) at org.junit.runners.BlockJUnit4ClassRunner.describeChild(BlockJUnit4ClassRunner.java:121) at org.junit.runners.BlockJUnit4ClassRunner.describeChild(BlockJUnit4ClassRunner.java:63) at org.junit.runners.ParentRunner.getDescription(ParentRunner.java:401) at org.junit.runners.model.RunnerBuilder.configureRunner(RunnerBuilder.java:81) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:72) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:37) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70) at org.junit.internal.requests.ClassRequest.createRunner(ClassRequest.java:28) at org.junit.internal.requests.MemoizingRequest.getRunner(MemoizingRequest.java:19) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:90) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:76) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:49) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:526) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:770) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481) at java.base/sun.util.locale.provider.LocaleProviderAdapter.forType(LocaleProviderAdapter.java:188) ... 25 more Caused by: java.util.ServiceConfigurationError: sun.util.locale.provider.LocaleDataMetaInfo: Unable to load sun.util.resources.cldr.provider.CLDRLocaleDataMetaInfo at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:584) at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:856) at java.base/java.util.ServiceLoader$ModuleServicesLookupIterator.hasNext(ServiceLoader.java:1078) at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1301) at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1386) at java.base/sun.util.cldr.CLDRLocaleProviderAdapter$1.run(CLDRLocaleProviderAdapter.java:89) at java.base/sun.util.cldr.CLDRLocaleProviderAdapter$1.run(CLDRLocaleProviderAdapter.java:86) at java.base/java.security.AccessController.doPrivileged(AccessController.java:554) at java.base/sun.util.cldr.CLDRLocaleProviderAdapter.(CLDRLocaleProviderAdapter.java:86) ... 31 more Caused by: java.lang.LinkageError: loader 'platform' attempted duplicate class definition for sun.util.resources.cldr.provider.CLDRLocaleDataMetaInfo. (sun.util.resources.cldr.provider.CLDRLocaleDataMetaInfo is in module jdk.localedata of loader 'platform') at java.base/java.lang.ClassLoader.defineClass2(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1108) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:183) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:784) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:705) at java.base/jdk.internal.loader.BuiltinClassLoader.findClass(BuiltinClassLoader.java:586) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:634) at java.base/java.lang.Class.forName(Class.java:546) at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:854) ... 38 more

And here the console StackTrace:

java.lang.instrument.IllegalClassFormatException: Error while instrumenting sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo. at org.jacoco.agent.rt.internal_43f5073.CoverageTransformer.transform(CoverageTransformer.java:94) at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:246) at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188) at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:563) at java.base/java.lang.ClassLoader.defineClass2(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1108) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:183) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:784) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:705) at java.base/jdk.internal.loader.BuiltinClassLoader.findClass(BuiltinClassLoader.java:586) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:634) at java.base/java.lang.Class.forName(Class.java:546) at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:854) at java.base/java.util.ServiceLoader$ModuleServicesLookupIterator.hasNext(ServiceLoader.java:1078) at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1301) at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1386) at java.base/sun.util.cldr.CLDRLocaleProviderAdapter$1.run(CLDRLocaleProviderAdapter.java:89) at java.base/sun.util.cldr.CLDRLocaleProviderAdapter$1.run(CLDRLocaleProviderAdapter.java:86) at java.base/java.security.AccessController.doPrivileged(AccessController.java:554) at java.base/sun.util.cldr.CLDRLocaleProviderAdapter.(CLDRLocaleProviderAdapter.java:86) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481) at java.base/sun.util.locale.provider.LocaleProviderAdapter.forType(LocaleProviderAdapter.java:188) at java.base/sun.util.locale.provider.LocaleProviderAdapter.findAdapter(LocaleProviderAdapter.java:287) at java.base/sun.util.locale.provider.LocaleProviderAdapter.getAdapter(LocaleProviderAdapter.java:258) at java.base/java.text.DecimalFormatSymbols.getInstance(DecimalFormatSymbols.java:180) at java.base/java.util.Formatter.getZero(Formatter.java:2437) at java.base/java.util.Formatter.(Formatter.java:1956) at java.base/java.util.Formatter.(Formatter.java:1978) at java.base/java.lang.String.format(String.java:3292) at org.junit.runner.Description.formatDisplayName(Description.java:114) at org.junit.runner.Description.createTestDescription(Description.java:86) at org.junit.runners.BlockJUnit4ClassRunner.describeChild(BlockJUnit4ClassRunner.java:121) at org.junit.runners.BlockJUnit4ClassRunner.describeChild(BlockJUnit4ClassRunner.java:63) at org.junit.runners.ParentRunner.getDescription(ParentRunner.java:401) at org.junit.runners.model.RunnerBuilder.configureRunner(RunnerBuilder.java:81) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:72) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:37) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70) at org.junit.internal.requests.ClassRequest.createRunner(ClassRequest.java:28) at org.junit.internal.requests.MemoizingRequest.getRunner(MemoizingRequest.java:19) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:90) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:76) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:49) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:526) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:770) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210) Caused by: java.io.IOException: Error while instrumenting sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo. at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrumentError(Instrumenter.java:159) at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrument(Instrumenter.java:109) at org.jacoco.agent.rt.internal_43f5073.CoverageTransformer.transform(CoverageTransformer.java:92) ... 50 more Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 59 at org.jacoco.agent.rt.internal_43f5073.asm.ClassReader.(ClassReader.java:195) at org.jacoco.agent.rt.internal_43f5073.asm.ClassReader.(ClassReader.java:176) at org.jacoco.agent.rt.internal_43f5073.asm.ClassReader.(ClassReader.java:162) at org.jacoco.agent.rt.internal_43f5073.core.internal.instr.InstrSupport.classReaderFor(InstrSupport.java:280) at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrument(Instrumenter.java:75) at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrument(Instrumenter.java:107) ... 51 more

What I find weird about the Stack Trace is that seems to try and use Junit4, despite the fact that I've always used 5 both before and after my changes in Eclipse, but that's about the only thing I can read out of it.

Does someone know which setting in my Eclipse broke or help me decode the StackTrace?

1
Java 15 is not yet supported in code coverage. Use Java 13 or lower (Java 8 and 11 are the only ones with long time support) for code coverage.howlger

1 Answers

0
votes

Try with Java 11 or java 1.8.281 JaCoCo version 0.8.5