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 interfaces #31350

Closed
bclozel opened this issue Oct 2, 2023 · 2 comments
Closed

AOT bean registrations miss reflection hints on interfaces #31350

bclozel opened this issue Oct 2, 2023 · 2 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 2, 2023

See #31213 for background.

This issue is similar to #31293, but this time applies to missing reflection hints on Java Interfaces. When the bean introspection processes a bean, we are reflecting on public (including inherited) methods and declared methods on the type itself, then looking at super classes and interfaces. While super classes are already covered by existing hints, introspecting interfaces for default methods and bean property methods is missing right now.

This results in exception like:

org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively access org.springframework.core.Ordered.getMethods() without it being registered for runtime reflection. Add org.springframework.core.Ordered.getMethods() 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.getMethods(DynamicHub.java:1004)
  org.springframework.beans.PropertyDescriptorUtils.determineBasicProperties(PropertyDescriptorUtils.java:62)
  org.springframework.beans.SimpleBeanInfoFactory.getBeanInfo(SimpleBeanInfoFactory.java:53)
  org.springframework.beans.CachedIntrospectionResults.getBeanInfo(CachedIntrospectionResults.java:228)
@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 2, 2023
@bclozel bclozel added this to the 6.1.0-RC1 milestone Oct 2, 2023
@bclozel bclozel self-assigned this Oct 2, 2023
@bclozel bclozel closed this as completed in b832df6 Oct 2, 2023
@bclozel
Copy link
Member Author

bclozel commented Oct 3, 2023

Reopening as we're not registering hints on the entire type hierarchy.

@bclozel bclozel reopened this Oct 3, 2023
@bclozel bclozel closed this as completed in 1fd5491 Oct 3, 2023
@bclozel
Copy link
Member Author

bclozel commented Oct 3, 2023

Reopening (again) because we're not registering hints on inherited interfaces.

@bclozel bclozel reopened this Oct 3, 2023
@bclozel bclozel closed this as completed in 28c9761 Oct 3, 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