You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[caffeine] : Multiple possible bean candidates found when using caffeine with service discovery [DiscoveryClientCacheConfiguration, DefaultCacheConfiguration]
#725
Open
kirpi4ik opened this issue
Feb 19, 2024
· 0 comments
Exception thrown during discovery client initialization
Caused by: io.micronaut.context.exceptions.NonUniqueBeanException: Multiple possible bean candidates found: [DiscoveryClientCacheConfiguration, DefaultCacheConfiguration]
at io.micronaut.context.DefaultBeanContext.findConcreteCandidate(DefaultBeanContext.java:2428)
at io.micronaut.context.DefaultApplicationContext.findConcreteCandidate(DefaultApplicationContext.java:606)
at io.micronaut.context.DefaultBeanContext.lastChanceResolve(DefaultBeanContext.java:3212)
at io.micronaut.context.DefaultBeanContext.pickOneBean(DefaultBeanContext.java:3156)
at io.micronaut.context.DefaultBeanContext.findConcreteCandidateNoCache(DefaultBeanContext.java:3112)
at io.micronaut.context.DefaultBeanContext.findConcreteCandidate(DefaultBeanContext.java:3095)
at io.micronaut.context.DefaultBeanContext.findBeanDefinition(DefaultBeanContext.java:2745)
at io.micronaut.context.DefaultBeanContext.resolveBeanRegistration(DefaultBeanContext.java:2720)
at io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:1729)
at io.micronaut.context.AbstractBeanResolutionContext.getBean(AbstractBeanResolutionContext.java:89)
at io.micronaut.context.AbstractInitializableBeanDefinition.resolveBean(AbstractInitializableBeanDefinition.java:2165)
... 91 common frames omitted
From initial investigation
DefaultSyncCache initialization is failing due to this constructor which injects base class CacheConfiguration
Expected Behavior
No response
Actual Behaviour
Exception thrown during discovery client initialization
From initial investigation
DefaultSyncCache initialization is failing due to this constructor which injects base class CacheConfiguration
There are two beans which extend this class, one from cache-caffeine[DefaultCacheConfiguration] and one from cashe-core[DiscoveryClientCacheConfiguration]
Steps To Reproduce
With discovery client and caffeine enabled :
enable discovery cache in application.yaml
Environment Information
JDK graalvm-jdk-21.0.2+13.1
OS: Win11x64
Example Application
No response
Version
4.2.4
The text was updated successfully, but these errors were encountered: