缓存: Null key returned for cache operation (maybe you are using named params on classes without debug

来源:互联网 发布:淘宝联盟 旧版 编辑:程序博客网 时间:2024/06/07 22:04

 错误:

Null key returned for cache operation (maybe you are using named params on classes without debug info?) Builder[public java.lang.String com.gwm.service.impl.TestService.selectById(java.io.Serializable)] caches=[hour] | key='#id' | keyGenerator='' | cacheManager='' | cacheResolver='' | condition='' | unless='' | sync='false'



 调用方法:

 @Cacheable(value = "hour", key = "#id")
public String selectById(Serializable id) {
    Long timestamp = System.currentTimeMillis();
         return timestamp.toString();


出错原因:  key中的id 没有传值,在调用方法时,不能传null值。

eg:

             Serializable id = "aa";
   String meg=testService.selectById(id);   传上值!!!!!



阅读全文
1 0
原创粉丝点击