Skip to content
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

AOT bean registrations miss reflection hints on property fields #31390

Closed
bclozel opened this issue Oct 9, 2023 · 0 comments
Closed

AOT bean registrations miss reflection hints on property fields #31390

bclozel opened this issue Oct 9, 2023 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@bclozel
Copy link
Member

bclozel commented Oct 9, 2023

See #31213 for background.

This issue is similar to #31293, but this time applies to missing reflection hints fields for property binding.
When the bean introspection processes a bean, we are reflecting on the fields to be bound with property values because of ReflectionUtils#findField calls. The missing reflection hint must be added on the right type, as the property value could be bound at any place in the type hierarchy.

When the hint is missing, we can get exceptions like:

org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively access org.springframework.aop.framework.ProxyConfig.getDeclaredFields() without it being registered for runtime reflection. Add org.springframework.aop.framework.ProxyConfig.getDeclaredFields() to the reflection metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection for help.
  java.base@21/java.lang.Class.getDeclaredFields(DynamicHub.java:1124)
  org.springframework.util.ReflectionUtils.getDeclaredFields(ReflectionUtils.java:752)
  org.springframework.util.ReflectionUtils.findField(ReflectionUtils.java:600)
  org.springframework.util.ReflectionUtils.findField(ReflectionUtils.java:582)
@bclozel bclozel added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels Oct 9, 2023
@bclozel bclozel added this to the 6.1.0-RC1 milestone Oct 9, 2023
@bclozel bclozel self-assigned this Oct 9, 2023
@bclozel bclozel closed this as completed in 8064659 Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant