FilterChain抛出javax.servlet.ServletException:IteratedExpression.getItem:索引超出界限

时间:2011-12-12 17:01:14

标签: java jsf richfaces servlet-filters

对于缺少代码示例表示抱歉,但我不确定是否可以在一个简单的示例中复制该问题。

以下例外最近已开始出现在我的RichFaces应用程序中。它是一个Web前端,用于查询数据库并在简单表中显示数据。当我的应用程序完成在链接到命令按钮的bean上执行我的代码时,会出现问题。当你单击弹出面板上的按钮调用FilterChain.doFilter,然后完成bean上的代码,然后我假设在尝试重新渲染主窗口时抛出此异常。

当一个新的入口点出现在同一个弹出式面板上,当单击该按钮时在bean上执行相同的代码时,问题就出现了,但是由于添加了这个新入口点,旧入口点已经开始抛出此异常。

我知道任何人都不可能在没有代码的情况下提供问题的答案,但对这些过滤器链如何工作几乎不了解,我甚至不确定从哪里开始寻找并且想知道是否有人可以指出我可能导致我找到解决方案的方向。

该服务正在WASCE 2.1上运行。

非常感谢任何帮助。

javax.servlet.ServletException: IteratedExpression.getItem: Index out of Bounds
at javax.faces.webapp._ErrorPageWriter.throwException(_ErrorPageWriter.java:549)
at javax.faces.webapp.FacesServlet.handleLifecycleException(FacesServlet.java:293)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:187)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at myPackage.jsfutils.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at myPacakge.jsfutils.CheckLogonFilter.doFilter(CheckLogonFilter.java:81)
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:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:406)
at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
at org.apache.geronimo.tomcat.valve.ThreadCleanerValve.invoke(ThreadCleanerValve.java:40)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: IteratedExpression.getItem: Index out of Bounds
at javax.servlet.jsp.jstl.core.IteratedExpression.getItem(IteratedExpression.java:75)
at javax.servlet.jsp.jstl.core.IteratedValueExpression.getValue(IteratedValueExpression.java:60)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:64)
at org.apache.el.parser.AstValue.getValue(AstValue.java:112)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
at javax.faces.component.UIData.getValue(UIData.java:1081)
at org.ajax4jsf.component.UIDataAdaptor.getValue(UIDataAdaptor.java:1624)
at org.ajax4jsf.component.SequenceDataAdaptor.getDataModel(SequenceDataAdaptor.java:65)
at org.ajax4jsf.component.SequenceDataAdaptor.createDataModel(SequenceDataAdaptor.java:59)
at org.richfaces.component.UIDataTable.createDataModel(UIDataTable.java:120)
at org.ajax4jsf.component.UIDataAdaptor.getExtendedDataModel(UIDataAdaptor.java:621)
at org.ajax4jsf.component.UIDataAdaptor.getRowIndex(UIDataAdaptor.java:311)
at javax.faces.component._ComponentUtils.idsAreEqual(_ComponentUtils.java:134)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:110)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:107)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:107)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:107)
at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:449)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:912)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:919)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:919)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:919)
at org.ajax4jsf.renderkit.RendererUtils.findComponentFor(RendererUtils.java:882)
at org.ajax4jsf.context.AjaxContextImpl.convertId(AjaxContextImpl.java:395)
at org.ajax4jsf.context.AjaxContextImpl.addRegionsFromComponent(AjaxContextImpl.java:331)
at org.ajax4jsf.component.AjaxActionComponent.setupReRender(AjaxActionComponent.java:96)
at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:60)
at org.ajax4jsf.component.UIInclude.broadcast(UIInclude.java:170)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
at org.ajax4jsf.component.AjaxViewRoot.broadcastAjaxEvents(AjaxViewRoot.java:340)
at org.ajax4jsf.application.AjaxViewHandler.processAjaxEvents(AjaxViewHandler.java:216)
at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:169)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:182)
... 29 more
2011-12-12 16:35:48,342 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
java.lang.RuntimeException: IteratedExpression.getItem: Index out of Bounds
at javax.servlet.jsp.jstl.core.IteratedExpression.getItem(IteratedExpression.java:75)
at javax.servlet.jsp.jstl.core.IteratedValueExpression.getValue(IteratedValueExpression.java:60)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:64)
at org.apache.el.parser.AstValue.getValue(AstValue.java:112)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
at javax.faces.component.UIData.getValue(UIData.java:1081)
at org.ajax4jsf.component.UIDataAdaptor.getValue(UIDataAdaptor.java:1624)
at org.ajax4jsf.component.SequenceDataAdaptor.getDataModel(SequenceDataAdaptor.java:65)
at org.ajax4jsf.component.SequenceDataAdaptor.createDataModel(SequenceDataAdaptor.java:59)
at org.richfaces.component.UIDataTable.createDataModel(UIDataTable.java:120)
at org.ajax4jsf.component.UIDataAdaptor.getExtendedDataModel(UIDataAdaptor.java:621)
at org.ajax4jsf.component.UIDataAdaptor.getRowIndex(UIDataAdaptor.java:311)
at javax.faces.component._ComponentUtils.idsAreEqual(_ComponentUtils.java:134)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:110)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:107)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:107)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:107)
at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:449)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:912)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:919)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:919)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:919)
at org.ajax4jsf.renderkit.RendererUtils.findComponentFor(RendererUtils.java:882)
at org.ajax4jsf.context.AjaxContextImpl.convertId(AjaxContextImpl.java:395)
at org.ajax4jsf.context.AjaxContextImpl.addRegionsFromComponent(AjaxContextImpl.java:331)
at org.ajax4jsf.component.AjaxActionComponent.setupReRender(AjaxActionComponent.java:96)
at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:60)
at org.ajax4jsf.component.UIInclude.broadcast(UIInclude.java:170)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
at org.ajax4jsf.component.AjaxViewRoot.broadcastAjaxEvents(AjaxViewRoot.java:340)
at org.ajax4jsf.application.AjaxViewHandler.processAjaxEvents(AjaxViewHandler.java:216)
at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:169)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:182)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at myPackage.jsfutils.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at myPackage.jsfutils.CheckLogonFilter.doFilter(CheckLogonFilter.java:81)
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:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:406)
at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
at org.apache.geronimo.tomcat.valve.ThreadCleanerValve.invoke(ThreadCleanerValve.java:40)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)

2 个答案:

答案 0 :(得分:2)

问题解决了,试图重新呈现不存在的部分面板。奇怪的是它只发生在一个入口点是在jsp中作为弹出面板上的确认按钮的rerender属性所以两个入口点使用相同的按钮和jsp声明。添加在缺少的部分,因为它本来就在那里,只能想象它被错误地删除或者svn合并。

答案 1 :(得分:1)

查看根本原因:

java.lang.RuntimeException: IteratedExpression.getItem: Index out of Bounds
at javax.servlet.jsp.jstl.core.IteratedExpression.getItem(IteratedExpression.java:75)
at javax.servlet.jsp.jstl.core.IteratedValueExpression.getValue(IteratedValueExpression.java:60)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:64)
at org.apache.el.parser.AstValue.getValue(AstValue.java:112)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
at javax.faces.component.UIData.getValue(UIData.java:1081)
at org.ajax4jsf.component.UIDataAdaptor.getValue(UIDataAdaptor.java:1624)
at org.ajax4jsf.component.SequenceDataAdaptor.getDataModel(SequenceDataAdaptor.java:65)
at org.ajax4jsf.component.SequenceDataAdaptor.createDataModel(SequenceDataAdaptor.java:59)
at org.richfaces.component.UIDataTable.createDataModel(UIDataTable.java:120)
...

这绝对与过滤器无关。请求恰好通过过滤器传递。如果过滤器会引起任何问题,你会在堆栈跟踪的第一行看到它。

您的具体问题很可能是由于未在后续请求中保留数据表的正确数据模型而导致的。托管bean显然位于请求范围内而不是视图范围内。要解决此问题,您需要将bean放在视图范围中,并在必要时检查数据模型保留/预加载逻辑。这应该在(post)构造函数和/或(动作)侦听器方法中进行,但肯定不在getter方法中。 getter方法应返回数据模型,仅此而已。

如果您仍然使用JSF 1.x,它没有新的JSF 2.x视图范围,则需要在引用请求范围的托管bean的页面中添加<a4j:keepAlive>