IllegalStateException:getAttribute:会话已失效
我的第一个 JSF/IceFaces(版本 1.8.2)应用程序在 JBoss 5.1.0 上运行时遇到问题。
一段时间后我收到一个异常,告诉我有关会话问题。这很奇怪,因为我根本不在我的代码中使用会话。以下日志显示,由于此错误(来自 JBoss),我的所有支持 bean 都无法实例化:
com.sun.faces.mgbean.ManagedBeanCreationException: Cant instantiate class: bean.Abgrenzungsreise. at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:191) at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:106) at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:368) at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:222) at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:86) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54) at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72) at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:61) at org.apache.el.parser.AstValue.getValue(AstValue.java:107) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186) at javax.faces.component.UISelectItems.getValue(UISelectItems.java:141) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.getSelectItems(MenuRenderer.java:637) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.countSelectOptionsRecursive(MenuRenderer.java:448) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.renderSelect(MenuRenderer.java:377) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:119) at com.icesoft.faces.component.ext.renderkit.MenuRenderer.encodeEnd(MenuRenderer.java:51) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:370) at com.icesoft.faces.renderkit.dom_html_basic.GridRenderer.encodeChildren(GridRenderer.java:208) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:358) at com.icesoft.faces.renderkit.dom_html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:96) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at com.icesoft.faces.component.util.CustomComponentUtils.renderChild(CustomComponentUtils.java:339) at com.icesoft.faces.component.paneltabset.PanelTabSetRenderer.writeTabCell(PanelTabSetRenderer.java:977) at com.icesoft.faces.component.paneltabset.PanelTabSetRenderer.encodeEnd(PanelTabSetRenderer.java:423) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:503) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:456) at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:159) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:19) at com.icesoft.faces.context.View$2$1.respond(View.java:48) at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.respondWith(ServletRequestResponse.java:201) at com.icesoft.faces.context.View$2.serve(View.java:77) at com.icesoft.faces.context.View.servePage(View.java:149) at com.icesoft.faces.webapp.http.core.SingleViewServer.service(SingleViewServer.java:52) at com.icesoft.faces.webapp.http.common.ServerProxy.service(ServerProxy.java:11) at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet$4.service(MainSessionBoundServlet.java:149) at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24) at com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16) at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23) at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53) at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23) at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:131) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310) at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:696) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:667) at org.apache.jsp.index_jsp._jspService(index_jsp.java:58) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:662) Caused by: com.icesoft.faces.webapp.http.core.SessionExpiredException: User session has expired or it was invalidated. at com.icesoft.faces.webapp.http.servlet.ProxyHttpSession.getAttribute(ProxyHttpSession.java:77) at com.icesoft.faces.webapp.http.servlet.ServletSessionAttributeMap.getAttribute(ServletSessionAttributeMap.java:16) at com.icesoft.faces.context.AbstractAttributeMap.containsKey(AbstractAttributeMap.java:85) at com.sun.faces.mgbean.BeanManager.isBeanInScope(BeanManager.java:177) at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:82) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54) at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72) at bean.Abgrenzungsreise.(Abgrenzungsreise.java:39) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186) ... 86 more
Caused by: java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1032) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:110) at com.icesoft.faces.webapp.http.servlet.ProxyHttpSession.getAttribute(ProxyHttpSession.java:75) ... 100 more 2011-01-28 08:05:54,326 ERROR [com.icesoft.faces.context.View] (http-0.0.0.0-8080-3) Problem encountered during View.servePage com.sun.faces.mgbean.ManagedBeanCreationException: Cant instantiate class: bean.Abgrenzungsreise. at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:191) at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:106) at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:368) at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:222) at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:86) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54) at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72) at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:61) at org.apache.el.parser.AstValue.getValue(AstValue.java:107) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186) at javax.faces.component.UISelectItems.getValue(UISelectItems.java:141) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.getSelectItems(MenuRenderer.java:637) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.countSelectOptionsRecursive(MenuRenderer.java:448) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.renderSelect(MenuRenderer.java:377) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:119) at com.icesoft.faces.component.ext.renderkit.MenuRenderer.encodeEnd(MenuRenderer.java:51) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:370) at com.icesoft.faces.renderkit.dom_html_basic.GridRenderer.encodeChildren(GridRenderer.java:208) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:358) at com.icesoft.faces.renderkit.dom_html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:96) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at com.icesoft.faces.component.util.CustomComponentUtils.renderChild(CustomComponentUtils.java:339) at com.icesoft.faces.component.paneltabset.PanelTabSetRenderer.writeTabCell(PanelTabSetRenderer.java:977) at com.icesoft.faces.component.paneltabset.PanelTabSetRenderer.encodeEnd(PanelTabSetRenderer.java:423) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:503) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:456) at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:159) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:19) at com.icesoft.faces.context.View$2$1.respond(View.java:48) at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.respondWith(ServletRequestResponse.java:201) at com.icesoft.faces.context.View$2.serve(View.java:77) at com.icesoft.faces.context.View.servePage(View.java:149) at com.icesoft.faces.webapp.http.core.SingleViewServer.service(SingleViewServer.java:52) at com.icesoft.faces.webapp.http.common.ServerProxy.service(ServerProxy.java:11) at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet$4.service(MainSessionBoundServlet.java:149) at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24) at com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16) at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23) at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53) at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23) at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:131) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310) at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:696) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:667) at org.apache.jsp.index_jsp._jspService(index_jsp.java:58) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:662) Caused by: com.icesoft.faces.webapp.http.core.SessionExpiredException: User session has expired or it was invalidated. at com.icesoft.faces.webapp.http.servlet.ProxyHttpSession.getAttribute(ProxyHttpSession.java:77) at com.icesoft.faces.webapp.http.servlet.ServletSessionAttributeMap.getAttribute(ServletSessionAttributeMap.java:16) at com.icesoft.faces.context.AbstractAttributeMap.containsKey(AbstractAttributeMap.java:85) at com.sun.faces.mgbean.BeanManager.isBeanInScope(BeanManager.java:177) at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:82) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54) at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72) at bean.Abgrenzungsreise.(Abgrenzungsreise.java:39) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186) ... 86 more Caused by: java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1032) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:110) at com.icesoft.faces.webapp.http.servlet.ProxyHttpSession.getAttribute(ProxyHttpSession.java:75) ... 100 more
我认识到该异常是在上次用户活动半小时后引发的。
I have a problem with my first JSF/IceFaces (version 1.8.2) application running on JBoss 5.1.0.
I recieve an exception after a while, telling me about session problems. This is weird, because i do not use sessions in my code at all. The following logs show that none of my backing beans can be instantiated because of this error (from JBoss):
com.sun.faces.mgbean.ManagedBeanCreationException: Cant instantiate class: bean.Abgrenzungsreise. at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:191) at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:106) at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:368) at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:222) at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:86) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54) at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72) at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:61) at org.apache.el.parser.AstValue.getValue(AstValue.java:107) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186) at javax.faces.component.UISelectItems.getValue(UISelectItems.java:141) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.getSelectItems(MenuRenderer.java:637) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.countSelectOptionsRecursive(MenuRenderer.java:448) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.renderSelect(MenuRenderer.java:377) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:119) at com.icesoft.faces.component.ext.renderkit.MenuRenderer.encodeEnd(MenuRenderer.java:51) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:370) at com.icesoft.faces.renderkit.dom_html_basic.GridRenderer.encodeChildren(GridRenderer.java:208) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:358) at com.icesoft.faces.renderkit.dom_html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:96) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at com.icesoft.faces.component.util.CustomComponentUtils.renderChild(CustomComponentUtils.java:339) at com.icesoft.faces.component.paneltabset.PanelTabSetRenderer.writeTabCell(PanelTabSetRenderer.java:977) at com.icesoft.faces.component.paneltabset.PanelTabSetRenderer.encodeEnd(PanelTabSetRenderer.java:423) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:503) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:456) at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:159) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:19) at com.icesoft.faces.context.View$2$1.respond(View.java:48) at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.respondWith(ServletRequestResponse.java:201) at com.icesoft.faces.context.View$2.serve(View.java:77) at com.icesoft.faces.context.View.servePage(View.java:149) at com.icesoft.faces.webapp.http.core.SingleViewServer.service(SingleViewServer.java:52) at com.icesoft.faces.webapp.http.common.ServerProxy.service(ServerProxy.java:11) at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet$4.service(MainSessionBoundServlet.java:149) at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24) at com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16) at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23) at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53) at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23) at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:131) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310) at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:696) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:667) at org.apache.jsp.index_jsp._jspService(index_jsp.java:58) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:662) Caused by: com.icesoft.faces.webapp.http.core.SessionExpiredException: User session has expired or it was invalidated. at com.icesoft.faces.webapp.http.servlet.ProxyHttpSession.getAttribute(ProxyHttpSession.java:77) at com.icesoft.faces.webapp.http.servlet.ServletSessionAttributeMap.getAttribute(ServletSessionAttributeMap.java:16) at com.icesoft.faces.context.AbstractAttributeMap.containsKey(AbstractAttributeMap.java:85) at com.sun.faces.mgbean.BeanManager.isBeanInScope(BeanManager.java:177) at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:82) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54) at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72) at bean.Abgrenzungsreise.(Abgrenzungsreise.java:39) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186) ... 86 more
Caused by: java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1032) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:110) at com.icesoft.faces.webapp.http.servlet.ProxyHttpSession.getAttribute(ProxyHttpSession.java:75) ... 100 more 2011-01-28 08:05:54,326 ERROR [com.icesoft.faces.context.View] (http-0.0.0.0-8080-3) Problem encountered during View.servePage com.sun.faces.mgbean.ManagedBeanCreationException: Cant instantiate class: bean.Abgrenzungsreise. at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:191) at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:106) at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:368) at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:222) at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:86) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54) at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72) at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:61) at org.apache.el.parser.AstValue.getValue(AstValue.java:107) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186) at javax.faces.component.UISelectItems.getValue(UISelectItems.java:141) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.getSelectItems(MenuRenderer.java:637) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.countSelectOptionsRecursive(MenuRenderer.java:448) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.renderSelect(MenuRenderer.java:377) at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:119) at com.icesoft.faces.component.ext.renderkit.MenuRenderer.encodeEnd(MenuRenderer.java:51) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:370) at com.icesoft.faces.renderkit.dom_html_basic.GridRenderer.encodeChildren(GridRenderer.java:208) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:358) at com.icesoft.faces.renderkit.dom_html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:96) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at com.icesoft.faces.component.util.CustomComponentUtils.renderChild(CustomComponentUtils.java:339) at com.icesoft.faces.component.paneltabset.PanelTabSetRenderer.writeTabCell(PanelTabSetRenderer.java:977) at com.icesoft.faces.component.paneltabset.PanelTabSetRenderer.encodeEnd(PanelTabSetRenderer.java:423) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:503) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:497) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:456) at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:159) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:19) at com.icesoft.faces.context.View$2$1.respond(View.java:48) at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.respondWith(ServletRequestResponse.java:201) at com.icesoft.faces.context.View$2.serve(View.java:77) at com.icesoft.faces.context.View.servePage(View.java:149) at com.icesoft.faces.webapp.http.core.SingleViewServer.service(SingleViewServer.java:52) at com.icesoft.faces.webapp.http.common.ServerProxy.service(ServerProxy.java:11) at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet$4.service(MainSessionBoundServlet.java:149) at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24) at com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16) at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23) at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53) at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23) at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:131) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310) at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:696) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:667) at org.apache.jsp.index_jsp._jspService(index_jsp.java:58) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:662) Caused by: com.icesoft.faces.webapp.http.core.SessionExpiredException: User session has expired or it was invalidated. at com.icesoft.faces.webapp.http.servlet.ProxyHttpSession.getAttribute(ProxyHttpSession.java:77) at com.icesoft.faces.webapp.http.servlet.ServletSessionAttributeMap.getAttribute(ServletSessionAttributeMap.java:16) at com.icesoft.faces.context.AbstractAttributeMap.containsKey(AbstractAttributeMap.java:85) at com.sun.faces.mgbean.BeanManager.isBeanInScope(BeanManager.java:177) at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:82) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54) at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72) at bean.Abgrenzungsreise.(Abgrenzungsreise.java:39) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186) ... 86 more Caused by: java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1032) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:110) at com.icesoft.faces.webapp.http.servlet.ProxyHttpSession.getAttribute(ProxyHttpSession.java:75) ... 100 more
I recognized that the exception is thrown an half hour after the last user activity.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
IceFaces 论坛上也报告了同样的问题:
建议的解决方案是:
和
至于您在任何地方都没有使用会话的声明,堆栈跟踪表明在引发此异常时它正在尝试创建会话范围的托管 bean。所以你肯定在使用会话:)
更新根据评论:你确实绝对不应该将(基于请求!!)
FacesContext
分配为static< /代码> 变量。此外,其他 Bean 的注入需要通过
faces-config.xml
中的
进行。否则它根本就不是“注入”,而只是手动访问另一个bean。通过注入,您可以让 JSF 完成将另一个 bean 设置为当前 bean 的属性的工作。可以在此处找到示例。The same problem has been reported on the IceFaces forums:
The proposed solutions were:
and
As to your statement that you aren't using the session anywhere, the stacktrace tells that it is attempting to create a session scoped managed bean when this exception was thrown. So you are definitely using the session :)
Update as per the comments: You should indeed definitely not assign the (request based!!)
FacesContext
as astatic
variable. Also, injecting of other beans needs to be taken place by<managed-property>
infaces-config.xml
. Otherwise it isn't "injecting" at all, but just manually accessing the other bean. With injecting, you're letting JSF do the work to set the other bean as a property of the current bean. An example can be found here.异常的原因是在我的 SessionBean 类中。
我在上面问过原因是否可能是通过 facesContext 将 bean 注入到另一个 bean 中。
现在我自己给出答案:“是的,这可能是原因。”
我可以随意在任何方法或构造函数之外实例化当前的 FacesContext,这不是一个好主意,因为在会话超时之后我使用旧的或者可能没有会话上下文。 MySessionBean 已重新加载或获取它的新实例,但它没有刷新 FacesContext。结果如上所述^^
结论:因此获取 FacesContext 属于方法或构造函数的代码块。
非常感谢您的帮助!
The reason for the exception was in my SessionBean classes.
I asked above if the reason can be the injection of beans into another via the facesContext.
Now i give the answer my self: "Yes it can be the reason."
I felt free to instantiate the current FacesContext outside of any method or the constructor, which was not a good idea, because after the session-timeout i used the old one or mabey no session context. MySessionBean was reloaded or get a new instance of it, but it didn't refresh the FacesContext. The result of this is described above^^
Conclusion: So getting the FacesContext belongs in the codeblock of a method or constructor.
Thank you very much for your help!