Comments (4)
Many errors are very confusing. And currently if you stray much beyond the existing usage demonstrated in samples, it will start failing (it is still pre 1.0).
That said, if you ever get a 'class not found' type message you can quickly try to fix that yourself by creating your own reflect-config.json file in the project META-INF/native-image folder, per the instructions in https://github.com/oracle/graal/blob/master/substratevm/REFLECTION.md.
However, in this case the feature is trying to tell you something early so we don't get a very cryptic error later. The features encapsulates hints on various types that suggest "oh if this type is being used, we need to make sure graal can reflect on these other types". At the moment each selector needs specific handling that specifics what types it might select. We'll need to add handling for ManagementContextConfigurationImportSelector
.
from spring-native.
This error happens when you add actuator support, so I turn it into a more general one.
from spring-native.
Similar error happened in spring-kafka-2.3.1-RELEASE
Fatal error: java.lang.IllegalStateException: java.lang.IllegalStateException: No @CompilationHint found for import selector: org.springframework.kafka.annotation.KafkaListenerConfigurationSelector
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:600)
at java.base/java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1006)
at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:462)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:315)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:454)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:115)
at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:479)
Caused by: java.lang.IllegalStateException: No @CompilationHint found for import selector: org.springframework.kafka.annotation.KafkaListenerConfigurationSelector
at org.springframework.graal.type.Type.getHints(Type.java:819)
at org.springframework.graal.support.ResourcesHandler.processType(ResourcesHandler.java:619)
at org.springframework.graal.support.ResourcesHandler.processType(ResourcesHandler.java:859)
at org.springframework.graal.support.ResourcesHandler.processType(ResourcesHandler.java:898)
at org.springframework.graal.support.ResourcesHandler.processType(ResourcesHandler.java:859)
at org.springframework.graal.support.ResourcesHandler.processType(ResourcesHandler.java:531)
at org.springframework.graal.support.ResourcesHandler.checkAndRegisterConfigurationType(ResourcesHandler.java:518)
at org.springframework.graal.support.ResourcesHandler.processSpringFactory(ResourcesHandler.java:461)
at org.springframework.graal.support.ResourcesHandler.processSpringFactories(ResourcesHandler.java:321)
at org.springframework.graal.support.ResourcesHandler.register(ResourcesHandler.java:104)
at org.springframework.graal.support.SpringFeature.beforeAnalysis(SpringFeature.java:79)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$7(NativeImageGenerator.java:669)
at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:63)
at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:669)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:530)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:445)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Error: Image build request failed with exit status 1
com.oracle.svm.driver.NativeImage$NativeImageError: Image build request failed with exit status 1
at com.oracle.svm.driver.NativeImage.showError(NativeImage.java:1482)
at com.oracle.svm.driver.NativeImage.build(NativeImage.java:1260)
at com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1222)
at com.oracle.svm.driver.NativeImage.main(NativeImage.java:1181)
at com.oracle.svm.driver.NativeImage$JDK9Plus.main(NativeImage.java:1665)
So this issue is not specific to spring-actuator
, and it requires a more general solution.
from spring-native.
There are now actuator samples in the repository so the feature does support basic usage of actuator - please try it out and let me know how it goes.
So this issue is not specific to spring-actuator, and it requires a more general solution.
The problem is difficult to solve in the general sense because import selectors can do anything they want in code to compute the result of calling them at runtime. It isn't reasonable to analyze the code to work it out, so we need a hint. The messages coming out now are warning there is no hint and failing early rather than more cryptically later. The docs discuss how to create a hint when you get the problem (and perhaps contribute it back):
Supporting actuator was writing a complicated hint. But as I was there I also dropped one in for the KafkaListenerConfigurationSelector
- however there will be import selectors out in the wild that we have no idea about, and supplying hints with them (or turning this error down to warning if you want to risk it) is the current mechanism to support it.
Please reopen if actuator not behaving for you, I am pretty sure our two samples do not cover it exhaustively.
from spring-native.
Related Issues (20)
- ConfigurationPropertiesBindException is thrown when properties class uses @ConstructorBinding in multi-module gradle spring boot project HOT 1
- NativeImageGeneratorRunner must not contain "." HOT 2
- Getting: 'Entity has no identifier' when Entity inherits AbstractAuditable<U, PK> HOT 1
- Not a managed type: class com.example.demo.domain.User Spring Boot HOT 1
- com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Builder class `com.demo.Test$Builder` does not have build method (name: 'build') HOT 1
- Through -- spring. config Location=xxx The specified configuration file cannot take effect HOT 1
- InvalidPathException when doing nativeCompile on windows HOT 1
- Mybatis - org.springframework.boot.context.properties.bind.MissingParametersCompilerArgumentException HOT 1
- How to use the 'org.springframework.experimental.aot' plugin? HOT 5
- Fix Spring Boot 2.7.6+ compatiblity
- i use Visual Studio Community to build spring-boot:2.7 failure HOT 5
- Native Image with Spring Boot 3.0.1 throwing Missing character set id 560 is not loaded at image build time Error HOT 1
- Cannot instantiate class: com.sun.jndi.ldap.LdapCtxFactory error with spring-native HOT 2
- ApplicationServletEnvironment class not found in spring-aot-0.12.1 AotApplicationContextFactory HOT 2
- org.springframework.boot.context.properties.ConfigurationPropertiesBeanRegistrationWriterSupplier not found in boot 3.0.1, but referenced from aot 0.12.1 HOT 1
- ProxyJCacheConfiguration ContextBootstrapInitializer Error HOT 6
- spring native 0.12.0 was supported spring-data-elasticsearch? HOT 7
- Aot build failure with commons-beanutils dependency HOT 1
- NoClassDefFoundError DispatcherServlet HOT 2
- How to add pagehelper-spring-boot-starter? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-native.