使用tomcat-redis-session-manager 实现session共享后程序后台发现报错如下,并且引起用户投诉。
三月 10, 2016 9:56:51 上午 org.apache.catalina.core.StandardHostValve custom
严重: Exception Processing ErrorPage[errorCode=500, location=/error.jsp]
org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.IllegalStateException: Race condition encountered: attempted to load session[6AA0605E6A4D496B048463DF6234AEE7] which has been created but not yet serialized.
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:488)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:466)
at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:337)
at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:427)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:200)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.servlet.ServletException: java.lang.IllegalStateException: Race condition encountered: attempted to load session[6AA0605E6A4D496B048463DF6234AEE7] which has been created but not yet serialized.
at org.apache.jsp.error_jsp._jspService(error_jsp.java:157)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
... 23 more
Caused by: java.lang.IllegalStateException: Race condition encountered: attempted to load session[6AA0605E6A4D496B048463DF6234AEE7] which has been created but not yet serialized.
at com.radiadesign.catalina.session.RedisSessionManager.loadSessionFromRedis(RedisSessionManager.java:395)
at com.radiadesign.catalina.session.RedisSessionManager.findSession(RedisSessionManager.java:321)
at org.apache.catalina.connector.Request.doGetSession(Request.java:2903)
at org.apache.catalina.connector.Request.getSession(Request.java:2300)
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:897)
at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:229)
at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:569)
at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:514)
at org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:147)
at org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:126)
at org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryImpl.java:112)
at org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:65)
at org.apache.jsp.error_jsp._jspService(error_jsp.java:77)
... 26 more
通过sessionID查询redis存储信息发现value为null导致。
产生错误的具体源代码信息如下:
查看官方(https://github.com/jcoleman/tomcat-redis-session-manager)最新版发现该问题已经被作者发现,但没有解决。
升级到官方最新版后可以解决报错问题,不能解决value值为null的问题。
存在的问题是value值为null的数据没有过期时间会一直存在redis中。
相关推荐
tomcat-redis-session-manager-1.2-tomcat-7-java-7tomcat-redis-session-manager-1.2-tomcat-7-java-7tomcat-redis-session-manager-1.2-tomcat-7-java-7tomcat-redis-session-manager-1.2-tomcat-7-java-7tomcat-...
"tomcat9+tomcat-cluster-redis-session-manager_4.0.zip"这个文件组合涉及到的是在Tomcat 9上实现负载均衡以及使用Redis作为Session管理器的高级配置。 首先,Tomcat 9是Apache Tomcat服务器的一个版本,它是Java ...
【标题】"tomcat-redis-session-manager包集合下载(tomcat8)"涉及的主要知识点是将Redis集成到Tomcat中管理会话(session),以提高Web应用的性能和可扩展性。 【描述】中提到的"所需的tomcat-redis-session-...
《深入理解Tomcat-Redis-Session-Manager:在Tomcat7和Tomcat8中的应用》 在现代Web应用程序开发中,session管理是一个至关重要的环节,它涉及到用户会话的持久化和跨请求的数据共享。传统的session管理方式在高...
`tomcat-redis-session-manager`就是这样一款解决方案,它将Tomcat的session管理与Redis相结合,实现了跨服务器的session共享。 首先,让我们理解`tomcat-redis-session-manager`的核心概念。这是一个开源项目,它...
3. "tomcat-cluster-redis-session-manager-3.0.jar":这是Tomcat Redis Session Manager的核心组件,实现了Tomcat的Session监听器和Manager接口,使得Tomcat能够将Session数据存储到Redis中,并在需要时从Redis中...
【标题】"tomcat-redis-session-manager jar包"是一个用于集成Redis进行Session管理的Java库,特别设计用于Apache Tomcat服务器。这个库使得在多台Tomcat服务器之间共享和协调用户的Session数据成为可能,从而提高了...
"tomcat-redis-session-manager"是一个解决方案,它将用户的Session信息存储在Redis缓存服务器中,从而实现跨服务器的Session共享。本篇文章将深入探讨这个话题,包括它的原理、配置以及实际应用。 **一、Session...
压缩文件包括tomcat-redis-session-manager-master-2.0.0.jar、jedis-2.7.3.jar、commons-pool2-2.3.jar三个jar包使用方法请参照https://github.com/jcoleman/tomcat-redis-session-manager。apache-tomcat-8.5.33....
《深入解析Tomcat-Redis-Session-Manager源码》 在现代Web应用中,服务器端会话管理是一个至关重要的部分,特别是在高并发、分布式环境中。Tomcat作为最流行的Java Servlet容器,提供了丰富的功能来支持这一需求。...
tomcat-redis-session-manager-2.0.0.jar,可用于Tomcat8下Redis的Session共享,亲测可用,还需要下载另外两个jar包:commons-pool2-2.4.2.jar和jedis-2.9.0.jar,maven仓库有,此处不再上传
标题中的“Tomcat8亲测可用 tomcat-redis-session-manager的jar包”指的是一个专为Tomcat8设计的,用于管理session的扩展组件。这个组件实现了将Tomcat应用服务器中的用户session数据存储到Redis分布式缓存系统中,...
用于配置 tomcat-redis-session-manager
tomcat-redis-session-manager-2.0.0.jar jedis-2.5.2.jar commons-pool2-2.2.jar 2.修改 conf 目录下的 context.xml 文件 <Valve className="com.orangefunction.tomcat.redissessions....
"tomcat-redis-session-manager-1.2-tomcat-6.jar" 和 "tomcat-redis-session-manager-1.2-tomcat-7-java-7.jar" 是针对Tomcat 6和Tomcat 7的Redis Session Manager实现,这两个jar文件提供了将Tomcat的session存储...
2、配置解压之后的redis-data-cache.properties(根据你的redis配置吧),配置完将这个文件放入tomcat/conf文件夹中;3、配置tomcat/cong/context.xml,增加如下两行: <Value className="tomcat.request.session....
tomcat-redis-session-manager-2.0.0.jar包,不用自己打包了,tomcat共享session到redis中,解决分布式应用的状态问题。
支持tomcat8的sessionManager,kuanrf-tomcat-redis-session-manager-1.0.jar
tomcat-redis-session-manager-master为tomcat集群分布式session分享功能,详细信息见http://blog.csdn.net/fengshizty?viewmode=list对应内容