您的位置:首页 > 其它

@Cacheable Null key returned for cache异常的解决方法

2016-04-22 00:00 489 查看
摘要: spring+ehcache缓存@Cacheable等注解在接口interface上报@Cacheable Null key returned for cache异常的解决方法

#####spring+ehcache缓存@Cacheable等注解在接口interface上报@Cacheable Null key returned for cache异常的解决方法

 

@Cacheable(value ="answerCache", key = "#questionId")
List<AnswerSet> getAnswerListByQuestion(int questionId, int answerId);

解决方法,key使用变量索引
 

@Cacheable(value ="answerCache", key = "#p0")
List<AnswerSet> getAnswerListByQuestion(int questionId, int answerId);

######原因:猜想可能是jdk在proxy的时候无法解析得到interface中的变量名
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: