At least one cache should be provided per cache operation.

要加cacheNames ;不然报错: java.lang.IllegalStateException: No cache could be resolved for 'Builder[public abstract java.util.List com.test.findByXXX()] caches=[] | key='' | keyGenerator='' | cacheManager='' | cacheResolver='' | condition='' | unless='' | sync='false'' using resolver 'org.springframework.cache.interceptor.SimpleCacheResolver@12fddded'. At least one cache should be provided per cache operation. 解决办法: @Cacheable(cacheNames = {"user","user"},key = "#id") 作者:我想起个好名字 链接:https://www.jianshu.com/p/101704f462e1 来源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
原文地址:https://www.cnblogs.com/suizhikuo/p/12719839.html