-
Notifications
You must be signed in to change notification settings - Fork 86
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
ClassNotFoundException with Caffeine and Spring Boot 3.2 #436
Comments
Therefore missing in {
"condition": {
"typeReachable": "com.github.benmanes.caffeine.cache.BoundedLocalCache$BoundedLocalLoadingCache"
},
"name": "com.github.benmanes.caffeine.cache.SSSW",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"com.github.benmanes.caffeine.cache.Caffeine",
"com.github.benmanes.caffeine.cache.AsyncCacheLoader",
"boolean"
]
}
]
} |
|
@bpfoster yeah, pre-AOT this was a neat trick because unloaded classes are basically free (just a little extra disk space). Thus, we could code generate the cache and the entry classes to minimize the memory footprint, e.g. only include the expiration timestamp if used. Using reflection avoids bloating the constant pool with a static mapping and that factory is cached making the cost a one-time class load followed by a map lookup and direct call to the constructor. All extremely cheap, hidden, classic JVM dynamism except now AOT peeks into the implementation and exposes this magic. There's not much we can do since it is breaking encapsulation and including all classes would bloat your native binary. I'm curious to see how Project Leyden will address this, as it might allow AOT for the main parts while not throwing out the JIT for dynamic parts. You can try this example if you want to use the agent to discover the classes (it will output the |
Hello! I use spring boot (v. 3.2.1) with
com.github.ben-manes.caffeine
(v. 3.1.8). When I make native-image with default configuration of CaffeineCacheManager, I get this error:I found similar problem here
If I understand this repo correct, it misses the metadata for Caffeine for version 3.1.8 and it misses class
com.github.benmanes.caffeine.cache.SSSW
The application starts if I add following hint manually:
This additional
CaffeineTest
leads to the same exception:The text was updated successfully, but these errors were encountered: