OpenHFT / Java-Runtime-Compiler

Java Runtime Compiler
Other
645 stars 144 forks source link

Java 17 load java class throws "java.lang.NoSuchFieldException: override" #109

Closed caogenfu closed 2 years ago

minborg commented 2 years ago

Are you able to show a stack trace on this?

caogenfu commented 2 years ago

│ Caused by: java.lang.NoSuchFieldException: override │ at java.lang.Class.getDeclaredField(Class.java:2610) ~[?:?] │ at net.openhft.compiler.CompilerUtils.(CompilerUtils.java:60) ~[compiler-2.4.1.jar!/:?] │ at com.zion.backend.support.utils.Utils.lambda$initClassPathForRuntimeCompiler$0(Utils.java:103) ~[classes!/:?] │ at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?] │ at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?] │ at java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1242) ~[?:?] │ at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?] │ at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?] │ at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?] │ at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?] │ at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] │ at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?] │ at com.zion.backend.support.utils.Utils.initClassPathForRuntimeCompiler(Utils.java:101) ~[classes!/:?] │ at com.zion.backend.support.utils.Utils.(Utils.java:82) ~[classes!/:?] │ at com.zion.backend.support.graphql.config.datamodel.DataModelHolder.init(DataModelHolder.java:59) ~[classes!/:?] │ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] │ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] │ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] │ at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] │ at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.3.10.jar!/:5.3.10] │ at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.10.jar!/:5.3.10]

JerryShea commented 2 years ago

Hi @caogenfu. This project builds and passes its tests in our CI environment against all our build scenarios including Java 8, 11 & 17. Can you re-try with the latest version to see if you can reproduce?