错误:
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); 传上值!!!!!