-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Native Image] ImportBeanDefinitionRegistrar not load the bean #10277
Comments
Hi @tadlakha9, Could you please try generating the metadata configuration files using the tracing agent? This could solve the issue that you're facing. |
Hello @selhagani Thanks for replying. yes we have followed the mentioned document and generate the metadata configuration file using the tracing agent, we have placed the generated |
I'm afraid I can't use the zip file you attached as a reproducer to investigate this issue any further. Could you please add your reproducer to a github repo and share it with me please? |
Here you can find the reproducer |
When trying to reproduce the issue I got the following error: |
we are using gradle 8.8 version but i think the issue you are referring to is just a warning not going to hamper anything. |
Hi @tadlakha9, |
@selhagani Did you find anything else which needs to be further analyzed |
You can just add "-H:ThrowMissingRegistrationErrors=true" to your config file instead of "--exact-reachability-metadata=com.example.practive" after that you can run the native-image executable while passing the following command "-XX:MissingRegistrationReportingMode=Warn". Also I am actively working on this on my end and I'll make sure to keep you updated once I find something. |
Describe the Issue
We have a scenario where we are loading a bean using a custom annotation with the help of
ImportBeanDefinitionRegistrar
but bean is not loaded and we are getting below exceptionGradle
bootRun
task is working fine.We have generated an executable(working fine), now while running the executable we are getting the issue, we are using
graalvm 17
. Facing the same issue withgraalvm 21
andgraalvm 23
Please find the reproducer.
practice.zip
Using the latest version of GraalVM can resolve many issues.
GraalVM Version
java version "17.0.13" 2024-10-15 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 17.0.13+10.1 (build 17.0.13+10-LTS-jvmci-23.0-b49)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 17.0.13+10.1 (build 17.0.13+10-LTS-jvmci-23.0-b49, mixed mode, sharing)
Operating System and Version
Linux 4.18.0-372.105.1.el8_6.x86_64 #1 SMP x86_64 GNU/Linux
Build Command
gradle nativeRun
Expected Behavior
our expectation is that the bean to be loaded while using ImportBeanDefinitionRegistrar
Actual Behavior
executable is generated perfectly fine, issue only while running the executable.
Steps to Reproduce
Additional Context
No response
Build Log Output and Error Messages
APPLICATION FAILED TO START
Description:
Parameter 0 of constructor in com.example.practice.service.CustomerService required a bean of type 'com.example.practice.client.CustomerClient' that could not be found.
Action:
Consider defining a bean of type 'com.example.practice.client.CustomerClient' in your configuration.
The text was updated successfully, but these errors were encountered: