Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
@CacheConfig(cacheNames) broken when used on interface [SPR-14781] #19347
Since upgrading from 4.1 to 4.3 we are seeing the following exception thrown in CacheAspectSupport.getCaches when a call to a
It seems to fail when the
We observe the same error if the
Moving down the
The difference compared to 4.1 (as far as I was manage to debug), seem to be that SpringCacheAnnotationParser.parseCacheAnnotations() now uses AnnotatedElementUtils.findAllMergedAnnotations(ae, CacheEvict.class)
In 4.1 SpringCacheAnnotationParser.parseCacheAnnotations() would return null when called with the UserServiceImpl.getUserByUsername as second argument. It would then return null all the way up to AbstractFallbackCacheOperationSource.computeCacheOperations() where it would fallback onto the following check:
The method here being the interface method.
In 4.3 it seems that SpringCacheAnnotationParser.parseCacheAnnotations() does not return null and that the defaultConfig of the interface is not merged with parsed annotations from the Impl method.
0 votes, 5 watchers
Juergen Hoeller commented
It turns out that due to the explicit fallback lookup between class and interface in