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
这个属性赋值,否则会抛异常.
网友评论