myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott O'Bryan" <darkar...@gmail.com>
Subject Re: java.lang.IllegalStateException: Invalid index - Server Exception during PPR
Date Fri, 06 Mar 2009 16:59:24 GMT
Hey Bruce,

I recently rewrote some logic in dealing with Trinidad dialogs.  We were 
doing something that was not expressly allowed by J2EE and some 
containers were failing on it.

My changes SHOULD have only effected in-line type dialogs (ie. ones that 
don't spin off an external window but instead replace their content in 
the main browser window) which is typically seen on mobile devices.  
There were some issues with this implementation that have been fixed.  I 
think the current trunk has all the necessary fixes.  Does the current 
trunk work with your solution?

Scott

brucemaki wrote:
> Hi,
> with release 1.2.10, and also with the last 1.2.11 i found a problem with
> dialogs opened by a jspx, (see the exception stak trace below).
> when i close the dialog window via a tr:commandButton (Confirm or Cancel) or
> by the X close icon the lifecicle of Jsf return a problem in RESTORE_VIEW,
> so the getViewRoot() of the FacesContext in the afterPhase event is NULL.
> With release 1.2.8 i've got no problems.
> This is my page that open the dialog:
>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
>           xmlns:f="http://java.sun.com/jsf/core"
>           xmlns:h="http://java.sun.com/jsf/html"
>           xmlns:trh="http://myfaces.apache.org/trinidad/html"
>           xmlns:tr="http://myfaces.apache.org/trinidad">
>     <jsp:directive.page contentType="text/html;charset=utf-8"/>
>
>     <f:view locale="#{Session.locale}">
>         <f:loadBundle  basename="com.hit.messaggi" var="msgs"/>
>         <trh:script source="/js/jsUploadR.js" />
>         <tr:document styleClass="BodyDoc" inlineStyle="margin-top:0px"
> title="#{msgs.label_modtitle}">
>             <tr:form id="myForm" usesUpload="true">
> 			.....
>             <tr:commandLink id="loadIssue" text="" partialSubmit="true"
> action="#{modifyAdP.doOpenCalendar}"
>                             useWindow="true" windowWidth="450"
> windowHeight="520" returnListener="#{modifyAdP.selectedIssues}"
> onclick="clearFileValue();">
>                 <tr:image inlineStyle="border:0px;"
>                     source ="/images/IT_AddData.gif"
>                     rendered="#{Session.isItalian}"/>
>                 <tr:image inlineStyle="border:0px;"
>                     source ="/images/EN_AddData.gif"
>                     rendered="#{Session.isEnglish}"/>
>             </tr:commandLink>
> 			
> 			.....
> 			</tr:form>
> 		</tr:document>
> 	</f:view>
> </jsp:root>
> --------------------------------------------------------------
> And this is my dialog
>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
>           xmlns:f="http://java.sun.com/jsf/core"
>           xmlns:h="http://java.sun.com/jsf/html"
>           xmlns:trh="http://myfaces.apache.org/trinidad/html"
>           xmlns:tr="http://myfaces.apache.org/trinidad">
>     <jsp:directive.page contentType="text/html;charset=utf-8"/>
>     <f:view>
>         <f:loadBundle basename="com.hit.messaggi" var="msgs"/>
>         <tr:document onload="parent.askQuit=false;
> dialogDropDownComponentRefresh();" title="#{msgs.label_isstitle}"
> inlineStyle="background-color:#ededed;">
>             <script type='text/javascript' language='javascript'>
>             //<![CDATA[
>             var isIE6 = navigator.userAgent.toLowerCase().indexOf('msie 6')
> != -1;
>             
>             function dialogDropDownComponentRefresh() {
>                 if (isIE6) {
>                     var allSelectElements =
> document.getElementsByTagName('select'); 
>                     if (allSelectElements) { 
>                         for (var i=0; i < allSelectElements.length; i++) { 
>                             var tr = allSelectElements[i]; 
>                             tr.style.cssText = 'display:inline !important;
> visibility: visible !important;'; 
>                         } 
>                     } 
>                 }
>             } 
>             //]]>
>             </script>
>
>             <tr:form  id="frmFascicoli">
>                 <table border="0" cellpadding="0" cellspacing="0"
> width="100%" style="background-color:#ededed;">
>                 <tr>
>                     <td align="center">
>                     <tr:spacer height="10px" />
>                     
>                     <!-- ANNO -->
>                     <tr:spacer height="10px" />
>
>                     <tr:selectOneChoice id="cmbYears" autoSubmit="true"
> label="#{msgs.label_issanno}" 
>                                         value="#{calIssues.anno}"
> valueChangeListener="#{calIssues.annoChanged}">
>                         <f:selectItems
> value="#{calIssues.listaAnni}"></f:selectItems>
>                     </tr:selectOneChoice>
>
>                     </td>
>                 </tr>
>                 
>                 <tr>
>                     <td align="center">
>                     <!-- TABELLA FASCICOLI -->
>                     <tr:panelBorderLayout styleClass="tab_contentResRicMat">
>                         <tr:table id="IssList" varStatus="status" first="0"
> width="95%" emptyText="#{msgs.label_issgrid_norec}" rowSelection="multiple"
> var="row"
>                         binding="#{calIssues.tableIssues}"
> value="#{calIssues.listIssues}" >
>                             <tr:column width="30%" align="center"
> headerText="#{msgs.label_isscodfasc}">
>                                 <tr:outputText
> value="#{row.fascicoloLabel}"/>
>                             </tr:column>
>                             <tr:column width="30%" align="center"
> headerText="#{msgs.label_issdatacop}">
>                                 <tr:outputText
> value="#{row.dataCopertina}"/>
>                             </tr:column>
>                             <tr:column width="30%" align="center"
> headerText="#{msgs.label_issdatauscita}">
>                                 <tr:outputText value="#{row.dataUscita}"/>
>                             </tr:column>
>                         </tr:table>
>                     </tr:panelBorderLayout>
>                     
>                     <tr:separator />
>                     <tr:spacer height="10px" />
>                     </td>
>                 </tr>
>                 <tr>
>                     <td align="center">
>                     <!-- PULSANTI -->
>                     <tr:commandButton text="#{msgs.label_issconferma}"
> action="#{calIssues.doSubmit}"  onclick="parent.askQuit=true;">
>                     </tr:commandButton>
>                     <tr:spacer width="20px"/>
>                     <tr:commandButton text="#{msgs.label_issannulla}"
> immediate="true" action="#{calIssues.doCancel}">
>                     </tr:commandButton>
>                     </td>
>                 </tr>
>                 </table>
>             </tr:form>
>         </tr:document>
>     </f:view>
> </jsp:root>
>
> --------------------------------------------------------------
>
> 6-mar-2009 8.36.16 com.sun.faces.lifecycle.LifecycleImpl phase
> AVVERTENZA: executePhase(RESTORE_VIEW
> 1,org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit@19ce6db)
> threw exception
> java.lang.IllegalStateException: Invalid index
>         at
> org.apache.myfaces.trinidad.bean.util.StateUtils.restoreKey(StateUtils.java:257)
>         at
> org.apache.myfaces.trinidad.bean.util.StateUtils.restoreState(StateUtils.java:351)
>         at
> org.apache.myfaces.trinidad.bean.util.FlaggedPropertyMap.restoreState(FlaggedPropertyMap.java:194)
>         at
> org.apache.myfaces.trinidad.bean.FacesBeanImpl.restoreState(FacesBeanImpl.java:347)
>         at
> org.apache.myfaces.trinidad.component.UIXComponentBase.restoreState(UIXComponentBase.java:928)
>         at
> org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:57)
>         at
> org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:902)
>         at
> org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
>         at
> org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:902)
>         at
> org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
>         at
> org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:902)
>         at
> org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
>         at
> org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:902)
>         at
> javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
>         at
> org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:626)
>         at
> com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:290)
>         at
> javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:193)
>         at
> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:275)
>         at
> com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:141)
>         at
> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
>         at
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
>         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
>         at
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
>         at
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
>         at
> org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at com.hit.webapp.RedirectFilter.doFilter(RedirectFilter.java:118)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at
> org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         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.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
>         at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>         at java.lang.Thread.run(Thread.java:619)
> 6-mar-2009 8.36.16
> org.apache.myfaces.trinidadinternal.config.xmlHttp.XmlHttpConfigurator
> handleError
> GRAVE: Server Exception during PPR, #1
> javax.servlet.ServletException: Invalid index
>         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
>         at
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
>         at
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
>         at
> org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at com.hit.webapp.RedirectFilter.doFilter(RedirectFilter.java:118)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at
> org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>         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.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
>         at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.IllegalStateException: Invalid index
>         at
> org.apache.myfaces.trinidad.bean.util.StateUtils.restoreKey(StateUtils.java:257)
>         at
> org.apache.myfaces.trinidad.bean.util.StateUtils.restoreState(StateUtils.java:351)
>         at
> org.apache.myfaces.trinidad.bean.util.FlaggedPropertyMap.restoreState(FlaggedPropertyMap.java:194)
>         at
> org.apache.myfaces.trinidad.bean.FacesBeanImpl.restoreState(FacesBeanImpl.java:347)
>         at
> org.apache.myfaces.trinidad.component.UIXComponentBase.restoreState(UIXComponentBase.java:928)
>         at
> org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:57)
>         at
> org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:902)
>         at
> org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
>         at
> org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:902)
>         at
> org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
>         at
> org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:902)
>         at
> org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
>         at
> org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:902)
>         at
> javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
>         at
> org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:626)
>         at
> com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:290)
>         at
> javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:193)
>         at
> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:275)
>         at
> com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:141)
>         at
> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
>         at
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
>         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
>         ... 24 more
>
>
>   


Mime
View raw message