各位小伙伴,我用ehcache做查询缓存,以下是调用方法:
//查询用户信息
public User findByIdInCache(String id) {
String sqlString = "SELECT tu.* FROM t_user tu WHERE tu.id = ? " ;
return this.findFirstByCache(DicUtil.CACHE_USER_INFO, id, sqlString, id);
}但是在Model.class源码中报错
public M findFirstByCache(String cacheName, Object key, String sql, Object... paras) {
ICache cache = _getConfig().getCache(); //这一行报空指针错误
M result = cache.get(cacheName, key);
if (result == null) {
result = findFirst(sql, paras);
cache.put(cacheName, key, result);
}
return result;
}报错截图如下:

附上我的项目中的ehcache,请波总和各位大神帮忙看看问题在哪!谢谢!
1、ehcache.xml文件的位置:

2、config中的插件配置:

3、pom文件中引入的jar包:

这样运行起来一直是报错findFirstByCache 空指针异常,请问各位有何高见,请不吝赐教,谢谢!
项目:JFinal