-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fail to run AOT process step on native build #4248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you please share a minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem. That would help us spot the issue. |
Sure @christophstrobl |
thanks @guillaume-1 - will have a look! |
Hi,
I tried to build a native image from a Spring Boot 3.0.0 project (Webflux based on Netty, Mongo reactive)
I've already created an issue on springboot project, but the error seems to be generated by spring data class : org.springframework.data.util.TypeContributor
Here my compile stacktrace with "gradle nativeCompile" command:
/ \ | ____ | | _ _ __ ___ | |()/ () ___ __ | |() ___ _ __ ___
\ | |/ /
| | | | | | '_ \ / _ \| __| | |_| |/ __/ _
| _| |/ _ | ' / __|\ \ < (| | | || | | | | | () | || | | | (| (| | || | () | | | _
_/|__,||_, | || ||_/ _||| ||__,|_||_/|| ||/
|__/
2022-12-04T11:41:48.834+01:00 INFO 45852 --- [ main] c.skaly.notifications.SkalyNotification : Starting SkalyNotification using Java 17.0.5 with PID 45852 (/Users/guillaumemartial/projects/skaly/skaly-notifications/build/classes/java/main started by guillaumemartial in /Users/guillaumemartial/projects/skaly/skaly-notifications)
2022-12-04T11:41:48.837+01:00 INFO 45852 --- [ main] c.skaly.notifications.SkalyNotification : The following 1 profile is active: "dev"
2022-12-04T11:41:49.305+01:00 INFO 45852 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Reactive MongoDB repositories in DEFAULT mode.
2022-12-04T11:41:49.405+01:00 INFO 45852 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 96 ms. Found 6 Reactive MongoDB repository interfaces.
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because the return value of "java.lang.Class.getCanonicalName()" is null
at org.springframework.aot.hint.BindingReflectionHintsRegistrar.shouldSkipMembers(BindingReflectionHintsRegistrar.java:74)
at org.springframework.aot.hint.BindingReflectionHintsRegistrar.lambda$registerReflectionHints$0(BindingReflectionHintsRegistrar.java:87)
at org.springframework.aot.hint.ReflectionHints.registerType(ReflectionHints.java:86)
at org.springframework.aot.hint.ReflectionHints.registerType(ReflectionHints.java:109)
at org.springframework.aot.hint.BindingReflectionHintsRegistrar.registerReflectionHints(BindingReflectionHintsRegistrar.java:86)
at org.springframework.aot.hint.BindingReflectionHintsRegistrar.registerReflectionHints(BindingReflectionHintsRegistrar.java:65)
at org.springframework.data.util.TypeContributor.contribute(TypeContributor.java:70)
at org.springframework.data.repository.config.RepositoryRegistrationAotProcessor.contributeType(RepositoryRegistrationAotProcessor.java:171)
at org.springframework.data.repository.config.RepositoryRegistrationAotProcessor.lambda$contribute$1(RepositoryRegistrationAotProcessor.java:85)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at org.springframework.data.repository.config.RepositoryRegistrationAotProcessor.contribute(RepositoryRegistrationAotProcessor.java:85)
at org.springframework.data.mongodb.repository.aot.AotMongoRepositoryPostProcessor.contribute(AotMongoRepositoryPostProcessor.java:35)
at org.springframework.data.repository.config.RepositoryRegistrationAotContribution.lambda$applyTo$0(RepositoryRegistrationAotContribution.java:253)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at org.springframework.data.repository.config.RepositoryRegistrationAotContribution.applyTo(RepositoryRegistrationAotContribution.java:253)
at org.springframework.beans.factory.aot.BeanDefinitionMethodGenerator.lambda$generateBeanDefinitionMethod$2(BeanDefinitionMethodGenerator.java:179)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.springframework.beans.factory.aot.BeanDefinitionMethodGenerator.generateBeanDefinitionMethod(BeanDefinitionMethodGenerator.java:178)
at org.springframework.beans.factory.aot.BeanDefinitionMethodGenerator.generateBeanDefinitionMethod(BeanDefinitionMethodGenerator.java:102)
at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.lambda$generateRegisterBeanDefinitionsMethod$2(BeanRegistrationsAotContribution.java:85)
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.generateRegisterBeanDefinitionsMethod(BeanRegistrationsAotContribution.java:83)
at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.lambda$applyTo$1(BeanRegistrationsAotContribution.java:67)
at org.springframework.aot.generate.GeneratedMethod.(GeneratedMethod.java:54)
at org.springframework.aot.generate.GeneratedMethods.add(GeneratedMethods.java:112)
at org.springframework.aot.generate.GeneratedMethods.add(GeneratedMethods.java:89)
at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.applyTo(BeanRegistrationsAotContribution.java:66)
at org.springframework.context.aot.BeanFactoryInitializationAotContributions.applyTo(BeanFactoryInitializationAotContributions.java:78)
at org.springframework.context.aot.ApplicationContextAotGenerator.lambda$processAheadOfTime$0(ApplicationContextAotGenerator.java:58)
at org.springframework.context.aot.ApplicationContextAotGenerator.withCglibClassHandler(ApplicationContextAotGenerator.java:67)
at org.springframework.context.aot.ApplicationContextAotGenerator.processAheadOfTime(ApplicationContextAotGenerator.java:53)
at org.springframework.context.aot.ContextAotProcessor.performAotProcessing(ContextAotProcessor.java:106)
at org.springframework.context.aot.ContextAotProcessor.doProcess(ContextAotProcessor.java:84)
at org.springframework.context.aot.ContextAotProcessor.doProcess(ContextAotProcessor.java:49)
at org.springframework.context.aot.AbstractAotProcessor.process(AbstractAotProcessor.java:82)
at org.springframework.boot.SpringApplicationAotProcessor.main(SpringApplicationAotProcessor.java:76)
Can you help me please ?
Thanks.
Guillaume
The text was updated successfully, but these errors were encountered: