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
@Configuration classes with Kotlin in native-image are broken #29663
Comments
Confirmed, I have bring this behavior to the attention of the Kotlin team and will share their feedback here. Worst case scenario, I guess we could configure introspect medadata for all functions of Kotlin classes. |
Feedback from Kotlin team:
So let's configure introspection on all functions for Kotlin classes. |
Kotlin reflection API invocation on a specific function may require iterating on all Java methods to find the right Kotlin function. As a consequence, this commit adds introspection hints on the class declared methods since the impact on the footprint is low. Closes spring-projectsgh-29663
Kotlin reflection API invocation on a specific function may require iterating on all Java methods to find the right Kotlin function. As a consequence, this commit adds introspection hints on the class declared methods for all Kotlin beans since the impact on the footprint is low. Closes spring-projectsgh-29663
Kotlin reflection API invocation on a specific function may require iterating on all Java methods to find the right Kotlin function. As a consequence, this commit adds introspection hints on the class declared methods for all Kotlin beans since the impact on the footprint is low. Closes spring-projectsgh-29663
Kotlin reflection API invocation on a specific function may require iterating on all Java methods to find the right Kotlin function. As a consequence, this commit adds introspection hints on the class declared methods for all Kotlin beans since the impact on the footprint is low. Closes spring-projectsgh-29663
This happens only in a native image. I have this configuration:
Running the application works. Now rename the
a()
method toz_a()
and it breaks:Demo project here: demo.zip
I debugged that to a behaviour in Kotlin reflection. Essentially you need reflection metadata for ALL methods (not only for the
@Bean
methods like it's at the moment) if you useResolvableType.forMethodReturnType(method)
. It depends on the iteration order of the methods. You can read more here: https://github.com/mhalbritter/kotlin-graalvm-reflectionThe text was updated successfully, but these errors were encountered: