首页 > 其他 > 详细

记一次redis踩坑

时间:2019-11-24 15:53:04      阅读:85      评论:0      收藏:0      [点我收藏+]

昨天和今天在实现redis缓存的时候,添加了一个SessionExpireFilter来更新当前登录用户的过期时间,在web.xml文件中配置了filter之后,tomcat死活启动不了,server里面报错:

One or more Filters failed to start. Full details will be found in the appropriate container log file ...

之后在C盘中找到了.interlliJ2019/system/tomcat/当前工程  下的logs目录,查看了此时的catalina.log和localhost.log

结果如下:

catalina.log

技术分享图片

localhost.log

技术分享图片

于是去google这个错误localhost.log中的这个错误:

严重: Exception starting filter SessionExpireFilter
javax.naming.NamingException: Cannot create resource instance

搜到结果如下所示:

技术分享图片

于是在自己的SessionExpireFilter中修改了自己的代码:

private RedisTemplate redisTemplate=new ClassPathXmlApplicationContext("applicationContext.xml").getBean(RedisTemplate.class);

重新启动,成功!

 

记一次redis踩坑

原文:https://www.cnblogs.com/reecelin/p/11922341.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!