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?
Try with Java 11 or java 1.8.281
JaCoCo version 0.8.5
Related
When I tried to run my project(no build errors)there was an exception:
Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationListener : org.springframework.boot.autoconfigure.BackgroundPreinitializer
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:438)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:420)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:413)
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:270)
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:250)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1214)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1203)
at com.inmobi.fuse.FuseServiceAppliaction.main(FuseServiceAppliaction.java:47)
Caused by: java.lang.NoClassDefFoundError: org/springframework/core/NativeDetector
at org.springframework.boot.autoconfigure.BackgroundPreinitializer.<clinit>(BackgroundPreinitializer.java:71)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:208)
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:434)
... 7 more
Caused by: java.lang.ClassNotFoundException: org.springframework.core.NativeDetector
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 14 more
I tried to resolve it, I updated my spring and jdk versions thinking it might be the reason but they all resulted in the same above exception.
Please see https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/. It says
Spring Native 0.10.2 only supports Spring Boot 2.5.3, so change the version if necessary.
If you are running an older version of spring boot than 2.5.3, please try to upgrade and see if that helps.
See https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent for a list of available versions of spring boot.
How to setup/run jaotc so it can find standard JDK classes ?
Using JDK 9 expiremental AOT compiler to pre-build some of the libraries, many fail for similar reasons. e.g.
jaotc --compile-for-tiered --info --output ../aoclib/postgresql-9.4.1208.so --jar ./postgresql-9.4.1208.jar
resuts in
Compiling ../aoclib/postgresql-9.4.1208...
(85 ms)
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jna/win32/StdCallLibrary
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1007)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:545)
at java.base/java.net.URLClassLoader.access$100(URLClassLoader.java:83)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:453)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:447)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:446)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:563)
at java.base/java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:890)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
at jdk.aot/jdk.tools.jaotc.collect.ClassSearch.loadClass(ClassSearch.java:55)
at jdk.aot/jdk.tools.jaotc.collect.ClassSearch.lambda$search$0(ClassSearch.java:47)
at jdk.aot/jdk.tools.jaotc.collect.jar.JarFileSource.eachClass(JarFileSource.java:47)
at jdk.aot/jdk.tools.jaotc.collect.ClassSearch.search(ClassSearch.java:47)
at jdk.aot/jdk.tools.jaotc.Main.run(Main.java:369)
at jdk.aot/jdk.tools.jaotc.Main.run(Main.java:306)
at jdk.aot/jdk.tools.jaotc.Main.main(Main.java:284)
Caused by: java.lang.ClassNotFoundException: com.sun.jna.win32.StdCallLibrary
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:563)
at java.base/java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:890)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
... 19 more
So when I try to connect to my hive metastore I'm getting this exception
javax.jdo.JDOFatalInternalException: Unexpected exception caught.
at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1193)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:808)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:701)
at org.apache.hadoop.hive.metastore.ObjectStore.getPMF(ObjectStore.java:412)
at org.apache.hadoop.hive.metastore.ObjectStore.getPersistenceManager(ObjectStore.java:441)
at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:336)
at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:292)
at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:73)
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
at org.apache.hadoop.hive.metastore.RawStoreProxy.<init>(RawStoreProxy.java:60)
at org.apache.hadoop.hive.metastore.RawStoreProxy.getProxy(RawStoreProxy.java:69)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newRawStore(HiveMetaStore.java:681)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:659)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:708)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:507)
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:78)
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:84)
at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:6286)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:207)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:187)
at com.bouygtel.jupiter.dic.catalogue.AspirationMetastore.aspirer(AspirationMetastore.java:146)
at com.bouygtel.jupiter.dic.integration.adaptateurs.AdaptateurUpdate.lambda$updateDatabase$0(AdaptateurUpdate.java:68)
at com.bouygtel.commun.summer.socle.coeur.threads.SummerExecutorServiceFactory$3.run(SummerExecutorServiceFactory.java:160)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at javax.jdo.JDOHelper$16.run(JDOHelper.java:1965)
at java.security.AccessController.doPrivileged(Native Method)
at javax.jdo.JDOHelper.invoke(JDOHelper.java:1960)
at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1166)
... 25 common frames omitted
Caused by: org.datanucleus.exceptions.NucleusUserException: Error : Could not find API definition for name "JDO". Perhaps you dont have the requisite datanucleus-api-XXX jar in the CLASSPATH?
at org.datanucleus.api.ApiAdapterFactory.getApiAdapter(ApiAdapterFactory.java:93)
at org.datanucleus.AbstractNucleusContext.<init>(AbstractNucleusContext.java:118)
at org.datanucleus.PersistenceNucleusContextImpl.<init>(PersistenceNucleusContextImpl.java:170)
at org.datanucleus.PersistenceNucleusContextImpl.<init>(PersistenceNucleusContextImpl.java:159)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.<init>(JDOPersistenceManagerFactory.java:436)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:314)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:223)
... 33 common frames omitted
But I have this in my pom.xml
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-api-jdo</artifactId>
<version>5.0.3</version>
</dependency>
The weird thing is that this only happens when I use my code through the jar, when I run it from eclipse, the thing works perfectly.
I double checked through "jar tf" and the jar that I run does contain the "datanucleus-api-jdo-5.0.3.jar".
I've searched for conflicts in my dependency hierarchy and there is one dependency that also use an older version of the "datanucleus-api-jdo", but it's omitted for conflict according to eclipse and excluding it does not solve the problem
Not sure if that helps but the run configuration within eclipse is "clean package spring-boot:run".
Any ideas of what is causing this?
If you think any information is missing please ask
We have Gradle script it is building multiple projects with different sourceCompatibility and targetCompatibility. If my environment variables JAVA_HOME set to jdk7 all the projects are building successfully. Then I changed the JAVA_HOME to jdk8. Now build fail with below errors:
FATAL ERROR in native method: processing of -javaagent failed
FATAL ERROR in native method: processing of -javaagent failed
ava.lang.VerifyError: Expecting a stackmap frame at branch target 51
Exception Details:
Location:
com/test/Tray.<clinit>()V #42: ifnull
Reason:
Expected stackmap frame at this location.
Bytecode:
0x0000000: 08bd 0063 5903 1264 5359 0412 6553 5905
0x0000010: 1266 5359 0612 6753 5907 1268 53b3 006a
0x0000020: 08bd 006c 5903 00b2 0080 c600 09b2 0080
0x0000030: a700 0c12 82b8 0084 59b3 0080 0053 5904
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.lang.RuntimeException: Class java/util/UUID could not be instrumented.
at org.jacoco.agent.rt_6l8m50.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:138)
at org.jacoco.agent.rt_6l8m50.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:99)
at org.jacoco.agent.rt_6l8m50.JacocoAgent.createRuntime(JacocoAgent.java:128)
at org.jacoco.agent.rt_6l8m50.JacocoAgent.init(JacocoAgent.java:74)
at org.jacoco.agent.rt_6l8m50.JacocoAgent.premain(JacocoAgent.java:165)
... 6 more
Caused by: java.lang.NoSuchFieldException: $jacocoAccess
at java.lang.Class.getField(Class.java:1703)
at org.jacoco.agent.rt_6l8m50.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:136)
... 10 more
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option UseSplitVerifier; support was removed in 8.0
Exception in thread "main" Could not write standard input into: Gradle Test Executor 2.
java.io.IOException: The pipe is being closed
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:326)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:50)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.lang.RuntimeException: Class java/util/UUID could not be instrumented.
at org.jacoco.agent.rt_6l8m50.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:138)
at org.jacoco.agent.rt_6l8m50.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:99)
at org.jacoco.agent.rt_6l8m50.JacocoAgent.createRuntime(JacocoAgent.java:128)
at org.jacoco.agent.rt_6l8m50.JacocoAgent.init(JacocoAgent.java:74)
at org.jacoco.agent.rt_6l8m50.JacocoAgent.premain(JacocoAgent.java:165)
... 6 more
Could you please tel me how to fix this issue with java8?
You may need to play around with your version of JaCoCo and/or ASM according to this. It's a known issue going back to about 2013. Go to the maven search site, find the latest versions and push your test dependencies to the latest available ones and see if that fixes it.
As my application gets broadened, I have decided to apply JUnit test so I can prevent NullPointerException
as much as possible especially in Activity & Place as well as RequestFactory.
However, I am trying to perform tests on ClientFactory, I have been able to pass arguments to JUnit like the
followijng:
gwt.test.jvmargs=-Xmx256M -Dgwt.args="-testBeginTimeout 5" -Dgwt.args="-prod" -Dgwt.args="-runStyle Manual:1"
When I ran the test, I am getting InternalCompilerException. Below is the error stack:
Validating newly compiled units
[ERROR] Errors in 'jar:file:/D:/gwt-2.1.1/gwt-user.jar!/com/google/gwt/logging/client/LogConfiguration.java'
[ERROR] Line 77: The method addHandler(Handler) is undefined for the type Logger
[ERROR] Failed to create an instance of 'com.google.gwt.junit.client.impl.JUnitHost' via deferred binding
com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
at com.google.gwt.dev.js.ast.JsVisitor.translateException(JsVisitor.java:466)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:452)
at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:423)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:98)
at com.google.gwt.dev.js.JsToStringGenerationVisitor.visit(JsToStringGenerationVisitor.java:667)
at com.google.gwt.dev.shell.Jsni$JsSourceGenWithJsniIdentFixup.visit(Jsni.java:224)
at com.google.gwt.dev.js.ast.JsInvocation.traverse(JsInvocation.java:64)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:450)
at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:423)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:98)
at com.google.gwt.dev.shell.Jsni$JsSourceGenWithJsniIdentFixup.visit(Jsni.java:219)
at com.google.gwt.dev.js.ast.JsInvocation.traverse(JsInvocation.java:64)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:450)
at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:423)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:98)
at com.google.gwt.dev.js.JsToStringGenerationVisitor.visit(JsToStringGenerationVisitor.java:286)
at com.google.gwt.dev.js.ast.JsArrayAccess.traverse(JsArrayAccess.java:72)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:450)
at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:423)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:98)
at com.google.gwt.dev.js.JsToStringGenerationVisitor.visit(JsToStringGenerationVisitor.java:311)
at com.google.gwt.dev.js.ast.JsBinaryOperation.traverse(JsBinaryOperation.java:108)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:450)
at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:423)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:98)
at com.google.gwt.dev.js.JsToStringGenerationVisitor.visit(JsToStringGenerationVisitor.java:509)
at com.google.gwt.dev.js.ast.JsExprStmt.traverse(JsExprStmt.java:37)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:450)
at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:423)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:98)
at com.google.gwt.dev.js.JsToStringGenerationVisitor.printJsBlock(JsToStringGenerationVisitor.java:1002)
at com.google.gwt.dev.js.JsSourceGenerationVisitor.visit(JsSourceGenerationVisitor.java:48)
at com.google.gwt.dev.js.ast.JsBlock.traverse(JsBlock.java:43)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:450)
at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:423)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:98)
at com.google.gwt.dev.shell.Jsni.generateJavaScriptForHostedMode(Jsni.java:255)
at com.google.gwt.dev.shell.Jsni.getJavaScriptForHostedMode(Jsni.java:242)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.createNativeMethods(ModuleSpaceOOPHM.java:49)
at com.google.gwt.dev.shell.CompilingClassLoader.injectJsniMethods(CompilingClassLoader.java:1215)
at com.google.gwt.dev.shell.CompilingClassLoader.findClass(CompilingClassLoader.java:1039)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at com.google.gwt.junit.client.impl.JUnitHost_Proxy.<clinit>(JUnitHost_Proxy.java:15)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.google.gwt.dev.shell.ModuleSpace.loadClassFromSourceName(ModuleSpace.java:654)
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:458)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
at com.google.gwt.core.client.GWT.create(GWT.java:97)
at com.google.gwt.junit.client.impl.GWTRunner.<init>(GWTRunner.java:184)
at com.google.gwt.junit.client.impl.GWTRunnerImplgecko1_8.<init>(GWTRunnerImplgecko1_8.java:6)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:465)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:375)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:183)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.SecurityException: Prohibited package name: java.io
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:479)
at java.lang.ClassLoader.defineClass(ClassLoader.java:614)
at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
at com.google.gwt.dev.shell.CompilingClassLoader.findClass(CompilingClassLoader.java:1011)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.google.gwt.dev.shell.CompilingClassLoader$DispatchClassInfoOracle.getClassFromBinaryName(CompilingClassLoader.java:236)
at com.google.gwt.dev.shell.CompilingClassLoader$DispatchClassInfoOracle.getClassFromBinaryOrSourceName(CompilingClassLoader.java:266)
at com.google.gwt.dev.shell.CompilingClassLoader$DispatchClassInfoOracle.getClassInfoFromClassName(CompilingClassLoader.java:288)
at com.google.gwt.dev.shell.CompilingClassLoader$DispatchClassInfoOracle.getDispId(CompilingClassLoader.java:146)
at com.google.gwt.dev.shell.CompilingClassLoader.getDispId(CompilingClassLoader.java:930)
at com.google.gwt.dev.shell.Jsni$JsSourceGenWithJsniIdentFixup.visit(Jsni.java:105)
at com.google.gwt.dev.js.ast.JsNameRef.traverse(JsNameRef.java:121)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:450)
... 61 more
[ERROR] Failed to create an instance of 'com.google.gwt.junit.client.impl.GWTRunner' via deferred binding
java.lang.RuntimeException: Deferred binding failed for 'com.google.gwt.junit.client.impl.JUnitHost' (did you forget to inherit a required module?)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53)
at com.google.gwt.core.client.GWT.create(GWT.java:97)
at com.google.gwt.junit.client.impl.GWTRunner.<init>(GWTRunner.java:184)
at com.google.gwt.junit.client.impl.GWTRunnerImplgecko1_8.<init>(GWTRunnerImplgecko1_8.java:6)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:465)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:375)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:183)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:503)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
... 13 more
[ERROR] Unable to load module entry point class com.google.gwt.junit.client.impl.GWTRunner (see associated exception for details)
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:503)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:375)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:183)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
at java.lang.Thread.run(Thread.java:619)
[ERROR] Failed to load module 'org.opevel.projectname.JUnit' from user agent 'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.19) Gecko/20110420 Firefox/3.5.19 GTB7.1' at localhost:2034
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:434)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:183)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
at java.lang.Thread.run(Thread.java:619)
Will appreciate some assistance.
Regards
The testing tools exposed by GWT's command line tools are not compatible with JUnit, resulting in the error:
Caused by: java.lang.SecurityException: Prohibited package name: java.io
You have two options:
If the unit you are testing doesn't call GWT.create() (implicitly or explicitly) or otherwise depend on native Javascript, you can use JUnit as you would with any other project (i.e. from the command line: java java org.junit.runner.JUnitCore ... Here is some more info on JUnit testing in GWT.
If the unit you are testing does somehow depend on native Javascript you need to use GWTTestCase which is described in the GWT documentation.
Consider looking into the MVP Pattern as one of its explicit goals is to make as much of an application as possible testable using JUnit (largely because it is much faster than tests based on GWTTestCase).