美文网首页
Springboot Redis @Cacheable

Springboot Redis @Cacheable

作者: 邮差在行动 | 来源:发表于2020-04-01 13:17 被阅读0次

    java.lang.IllegalStateException: No cache could be resolved for ‘Builder[public cn.jump.mapper.user.User cn.jump.user.UserServiceImpl.get(long)] caches=[] | key=’#userId+‘User’’ | keyGenerator=’’ | cacheManager=’’ | cacheResolver=’’ | condition=’’ | unless=’#result == null’ | sync=‘false’’ using resolver ‘org.springframework.cache.interceptor.SimpleCacheResolver@6305946e’. At least one cache should be provided per cache operation.
    at org.springframework.cache.interceptor.CacheAspectSupport.getCaches(CacheAspectSupport.java:226) ~[spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE]

    需要给 cacheNames这个属性赋值,否则会抛异常.

    来源:
    https://blog.csdn.net/q1378848/article/details/98882519

    相关文章

      网友评论

          本文标题:Springboot Redis @Cacheable

          本文链接:https://www.haomeiwen.com/subject/wysouhtx.html