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

Add support for @Cacheable in native-image #28943

Closed
mhalbritter opened this issue Aug 9, 2022 · 1 comment
Closed

Add support for @Cacheable in native-image #28943

mhalbritter opened this issue Aug 9, 2022 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) theme: aot An issue related to Ahead-of-time processing
Milestone

Comments

@mhalbritter
Copy link
Contributor

mhalbritter commented Aug 9, 2022

@Cacheable doesn't work in native-image. There is no exception, the annotated method is called multiple times, while as on the JVM, it's only called once.

You can observe this in https://github.com/spring-projects/spring-aot-smoke-tests/tree/main/cache-caffeine

I guess this is related to the "proxies in native-image" issue.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 9, 2022
@sdeleuze sdeleuze self-assigned this Aug 10, 2022
@sdeleuze sdeleuze added theme: aot An issue related to Ahead-of-time processing and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Aug 10, 2022
@sdeleuze sdeleuze added this to the 6.0.0-M6 milestone Aug 10, 2022
@sdeleuze sdeleuze added the in: core Issues in core modules (aop, beans, core, context, expression) label Aug 10, 2022
@sdeleuze
Copy link
Contributor

sdeleuze commented Aug 11, 2022

I think there is no exception because there are missing reflection hints for @Cacheable and related annotated method.

There is also a need for a CacheableBeanRegistrationAotProcessor to register related JDK dynamic proxies when they are used. Class proxies will hopefully be supported via #28115 once integrated in Spring Boot.

sdeleuze added a commit to sdeleuze/spring-framework that referenced this issue Aug 17, 2022
sdeleuze added a commit to sdeleuze/spring-aot-smoke-tests that referenced this issue Aug 17, 2022
sdeleuze added a commit to sdeleuze/spring-aot-smoke-tests that referenced this issue Aug 17, 2022
snicoll pushed a commit to spring-projects/spring-aot-smoke-tests that referenced this issue Aug 17, 2022
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
Projects
None yet
Development

No branches or pull requests

3 participants