Skip to content

9.0 (fix): register the native hints the cache manager expression needs - #17183

Merged
codeconsole merged 1 commit into
apache:9.0.xfrom
codeconsole:fix/cache-manager-native-hints-9.0.x
Nov 26, 2026
Merged

codeconsole merged 1 commit into
apache:9.0.xfrom
codeconsole:fix/cache-manager-native-hints-9.0.x

Conversation

@codeconsole

Copy link
Copy Markdown
Contributor

#17157 injects grailsCacheManager into a cache-aware class through a SpEL @Value expression. The expression reaches BeanExpressionContext.getBeanFactory(), AbstractBeanFactory.containsBean(String), AbstractBeanFactory.isTypeMatch(String, Class) and the CacheManager type by reflection. A native image refuses that reflection unless it is registered, so the native-i18n end-to-end app has failed at startup on 9.0.x since the merge (run):

Error creating bean with name 'grailsCacheAdminService': Unsatisfied dependency expressed through field
'org_grails_plugin_cache_GrailsCacheManagerAware__grailsCacheManager': Expression parsing failed
EL1008E: Property or field 'beanFactory' cannot be found on object of type 'BeanExpressionContext'

GrailsCacheManagerRuntimeHints, registered in grails-cache's new META-INF/spring/aot.factories, registers those methods and that type. GrailsCacheManagerRuntimeHintsSpec loads the registrar the way Spring does, through AotServices, and checks each hint. The native-i18n step of the End to End workflow is the test that the hints are sufficient.

…e image

The expression that injects grailsCacheManager into a cache-aware class
reads the bean factory, its containsBean and isTypeMatch methods, and the
CacheManager type by reflection, which a native image refuses without
hints: grailsCacheAdminService failed with EL1008E in the native-i18n
end-to-end test.
@codeconsole
codeconsole merged commit 50ce502 into apache:9.0.x Nov 26, 2026
3 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant