Replies: 1 comment 6 replies
-
Your build is misconfigured, it's recommended to use the version provided in BOM |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
With micronaut platform 4.7.0 (micronaut core 4.7.5) application (use maven and jdk21), I found that annotation processor micronaut-inject-java has ClassNotFoundException of io.micronaut.core.annotation.BuildTimeInit, or io.micronaut.context.conditions, or io.micronaut.core.annotation.AnnotationClassValue$UnresolvedClass
The build section of pom.xml
When I use micronaut platform 4.5.1, I did not have micronaut-core and micronaut-context in annotationProcessorPaths. When I update to micronaut platform 4.7.0, I start to get compilation error of ClassNotFoundException (exception stack trace provided in PS section), and I add micronaut-core and micronaut-context in annotationProcessorPaths, the build works.
I like to know if this is the right way to fix the build when updating to 4.7.0? Or there is a "cleaner" way to handle this.
PS stack trace
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.12.1:compile (default-compile) on project microservice-framework-runtime-aws-generic: Compilation failure
[ERROR] java.lang.NoClassDefFoundError: io/micronaut/core/annotation/BuildTimeInit
[ERROR] at io.micronaut.inject.writer.EvaluatedExpressionProcessor.(EvaluatedExpressionProcessor.java:49)
[ERROR] at io.micronaut.inject.writer.BeanDefinitionWriter.(BeanDefinitionWriter.java:772)
[ERROR] at io.micronaut.inject.writer.BeanDefinitionWriter.(BeanDefinitionWriter.java:653)
[ERROR] at io.micronaut.inject.processing.DeclaredBeanElementCreator.createBeanDefinitionVisitor(DeclaredBeanElementCreator.java:97)
[ERROR] at io.micronaut.inject.processing.DeclaredBeanElementCreator.buildInternal(DeclaredBeanElementCreator.java:82)
[ERROR] at io.micronaut.inject.processing.AbstractBeanElementCreator.build(AbstractBeanElementCreator.java:74)
[ERROR] at io.micronaut.annotation.processing.BeanDefinitionInjectProcessor.process(BeanDefinitionInjectProcessor.java:188)
[ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:1021)
[ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:937)
[ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1265)
[ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1380)
[ERROR] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1272)
[ERROR] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:946)
[ERROR] at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:319)
[ERROR] at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:178)
[ERROR] at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
[ERROR] at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:50)
[ERROR] Caused by: java.lang.ClassNotFoundException: io.micronaut.core.annotation.BuildTimeInit
[ERROR] at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
[ERROR] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
[ERROR] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
[ERROR] ... 17 more
[ERROR] java.lang.NoClassDefFoundError: io/micronaut/core/annotation/AnnotationClassValue$UnresolvedClass
[ERROR] at io.micronaut.annotation.processing.JavaAnnotationMetadataBuilder.readAnnotationRawValues(JavaAnnotationMetadataBuilder.java:378)
[ERROR] at io.micronaut.annotation.processing.JavaAnnotationMetadataBuilder.readAnnotationRawValues(JavaAnnotationMetadataBuilder.java:358)
[ERROR] at io.micronaut.annotation.processing.JavaAnnotationMetadataBuilder.readAnnotationRawValues(JavaAnnotationMetadataBuilder.java:68)
[ERROR] at io.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder.createAnnotationValue(AbstractAnnotationMetadataBuilder.java:899)
[ERROR] at io.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder.lambda$annotationMirrorToAnnotationValue$5(AbstractAnnotationMetadataBuilder.java:849)
[ERROR] at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[ERROR] at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
[ERROR] at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
[ERROR] at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
[ERROR] at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
[ERROR] at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
[ERROR] at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
[ERROR] at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
[ERROR] at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
[ERROR] at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
[ERROR] at io.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder.addAnnotations(AbstractAnnotationMetadataBuilder.java:987)
[ERROR] at io.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder.addAnnotations(AbstractAnnotationMetadataBuilder.java:830)
[ERROR] at io.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder.buildInternalMulti(AbstractAnnotationMetadataBuilder.java:800)
[ERROR] at io.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder.buildInternal(AbstractAnnotationMetadataBuilder.java:246)
[ERROR] at io.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder.lookupOrBuild(AbstractAnnotationMetadataBuilder.java:235)
[ERROR] at io.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder.lookupOrBuildForType(AbstractAnnotationMetadataBuilder.java:199)
[ERROR] at io.micronaut.inject.ast.annotation.AbstractElementAnnotationMetadataFactory.lookupForClass(AbstractElementAnnotationMetadataFactory.java:202)
[ERROR] at io.micronaut.inject.ast.annotation.AbstractElementAnnotationMetadataFactory$11.lookup(AbstractElementAnnotationMetadataFactory.java:385)
[ERROR] at io.micronaut.inject.ast.annotation.AbstractElementAnnotationMetadataFactory$AbstractElementAnnotationMetadata.getCacheEntry(AbstractElementAnnotationMetadataFactory.java:451)
[ERROR] at io.micronaut.inject.ast.annotation.AbstractElementAnnotationMetadataFactory$AbstractElementAnnotationMetadata.getAnnotationMetadata(AbstractElementAnnotationMetadataFactory.java:461)
[ERROR] at io.micronaut.core.annotation.AnnotationMetadataDelegate.findRepeatableAnnotation(AnnotationMetadataDelegate.java:661)
[ERROR] at io.micronaut.core.annotation.AnnotationMetadataDelegate.findRepeatableAnnotation(AnnotationMetadataDelegate.java:661)
[ERROR] at io.micronaut.inject.annotation.AnnotationMetadataHierarchy.findRepeatableAnnotation(AnnotationMetadataHierarchy.java:1035)
[ERROR] at io.micronaut.core.annotation.AnnotationMetadata.hasStereotype(AnnotationMetadata.java:1497)
[ERROR] at io.micronaut.core.annotation.AnnotationMetadataDelegate.hasStereotype(AnnotationMetadataDelegate.java:519)
[ERROR] at io.micronaut.core.annotation.AnnotationMetadataDelegate.hasStereotype(AnnotationMetadataDelegate.java:519)
[ERROR] at io.micronaut.validation.visitor.ValidationVisitor.visitMethod(ValidationVisitor.java:102)
[ERROR] at io.micronaut.validation.visitor.ValidationVisitor.lambda$visitClass$0(ValidationVisitor.java:81)
[ERROR] at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
[ERROR] at io.micronaut.validation.visitor.ValidationVisitor.visitClass(ValidationVisitor.java:81)
[ERROR] at io.micronaut.annotation.processing.TypeElementVisitorProcessor.visitClass(TypeElementVisitorProcessor.java:316)
[ERROR] at io.micronaut.annotation.processing.TypeElementVisitorProcessor.process(TypeElementVisitorProcessor.java:269)
[ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:1021)
[ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:937)
[ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1265)
[ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1380)
[ERROR] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1272)
[ERROR] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:946)
[ERROR] at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:319)
[ERROR] at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:178)
[ERROR] at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
[ERROR] at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:50)
[ERROR] Caused by: java.lang.ClassNotFoundException: io.micronaut.core.annotation.AnnotationClassValue$UnresolvedClass
[ERROR] at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
[ERROR] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
[ERROR] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
[ERROR] ... 47 more
Beta Was this translation helpful? Give feedback.
All reactions