3 Replies Latest reply on May 30, 2007 2:45 PM by Brian Smith

    Crazy rendering after validation error (post 4.2 upgrade)

    Chris Lowe Apprentice

      Whenever I submit a form that fails validation, the form renders the correct validation messages but I get some weird rendering of the form. It's actually like the previous HTML doesn't get cleared and the new form + validation errors gets tacked onto the end - I'm literally seeing double. If I click my submit button again, then a third instance will be tacked onto the bottom, and so on. If I simply refresh the page, then everything resets. If I use the application without causing validation errors then everything works as normal. I get the same behaviour on FireFox and IE and there are no exceptions in the logs.

      I'm slowly resolving various issues following an upgrade to Seam CVS 28/05/2007 and JBoss 4.2 but this latest one has me stumped.

      Could anyone offer any pointers on where to begin with something like this?

      Chris.

        • 1. Re: Crazy rendering after validation error (post 4.2 upgrade
          Chris Lowe Apprentice

          Getting a bit further with this.

          I'm using Trinidad (trinidad-*-1.2-07-may-SNAPSHOT.jar) and I'm using the <trh:body> tag in my pages, this alone was causing the duplication of my pages on validation error.

          Along the same lines, <tr:commandLink> also causes the individual link to duplicate.

          Has anyone come across this before?

          Cheers,

          C.


          PS - I tried to replicate this with the SeamDiscs example however if I click on the Artists or Discs links at the top of the page I get the following exception:

          09:02:16,203 ERROR [STDERR] 30-May-2007 09:02:16 com.sun.facelets.FaceletViewHandler handleRenderException
          SEVERE: Error Rendering View[/artists.xhtml]
          java.lang.IndexOutOfBoundsException: Index: 4,Size: 4
           at java.util.SubList.rangeCheck(AbstractList.java:746)
           at java.util.SubList.get(AbstractList.java:619)
           at org.jboss.seam.trinidad.EntityKeyManager.getKey(EntityKeyManager.java:53)
           at org.jboss.seam.trinidad.EntityCollectionModel.getRowKey(EntityCollectionModel.java:24)
           at org.apache.myfaces.trinidad.component.UIXCollection.getRowKey(UIXCollection.java:363)
           at org.apache.myfaces.trinidad.component.UIXCollection._saveStampState(UIXCollection.java:1138)
           at org.apache.myfaces.trinidad.component.UIXCollection.preRowDataChange(UIXCollection.java:684)
           at org.apache.myfaces.trinidad.component.UIXCollection.setRowKey(UIXCollection.java:420)
           at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.table.TableUtils$RowLoop._restoreOldState(TableUtils.java:60)
           at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.table.TableUtils$RowLoop.run(TableUtils.java:80)
           at org.apache.myfaces.trinidadinternal.renderkit.core.desktop.DesktopTableRenderer._renderTableRows(DesktopTableRenderer.java:903)
           at org.apache.myfaces.trinidadinternal.renderkit.core.desktop.DesktopTableRenderer.renderTableRows(DesktopTableRenderer.java:637)
           at org.apache.myfaces.trinidadinternal.renderkit.core.desktop.DesktopTableRenderer.renderTableContent(DesktopTableRenderer.java:363)
           at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.TableRenderer.encodeAll(TableRenderer.java:282)
           at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:184)
           at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:701)
           at org.apache.myfaces.trinidad.component.UIXCollection.encodeEnd(UIXCollection.java:525)
           at org.apache.myfaces.trinidad.render.RenderUtils.encodeRecursive(RenderUtils.java:70)
           at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:258)
           at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:280)
           at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:73)
           at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:153)
           at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:184)
           at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:701)
           at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
           at org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
           at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:189)
           at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:184)
           at org.ajax4jsf.framework.renderer.RendererBase.encodeChildren(RendererBase.java:121)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
           at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:250)
           at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:280)
           at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:73)
           at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.renderContent(BodyRenderer.java:137)
           at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:153)
           at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:79)
           at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:184)
           at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:701)
           at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1225)
           at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:721)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
           at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:571)
           at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:182)
           at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
           at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:232)
           at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
           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:210)
           at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:167)
           at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:140)
           at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:93)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:59)
           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:47)
           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:81)
           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
           at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:126)
           at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:248)
           at org.jboss.seam.web.AbstractAjax4jsfFilter.doFilter(AbstractAjax4jsfFilter.java:35)
           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:64)
           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
           at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:126)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           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:230)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
           at org.ap
          09:02:16,203 ERROR [STDERR] ache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
           at java.lang.Thread.run(Thread.java:619)
          



          • 2. Re: Crazy rendering after validation error (post 4.2 upgrade
            Chris Lowe Apprentice

            To reproduce this in the Seam-Discs example, I added a required field to home.xhtml as follows:

            view/home.xhtml
            ...
             </f:facet>
             </tr:tree>
            
            <div style="width: 200px; height: 50px; border: 1px solid red; margin-top: 20px;">
             <h:inputText value="#{artistHome.testValue}" required="true" />
             <br />
             <tr:commandLink action="#{artistHome.dummy}" >Dummy</tr:commandLink>
             </div>
             </tr:form>
             </tr:panelPartialRoot>
             </rich:panel>
            ...


            org.jboss.seam.example.seamdiscs.action.ArtistHome.java
            
            package org.jboss.seam.example.seamdiscs.action;
            
            ...
            import org.jboss.seam.log.Log;
            import org.jboss.seam.annotations.Logger;
            
            
            @Name("artistHome")
            public class ArtistHome {
            
            ...
            
             public void dummy() {
             }
            
             public void setTestValue(String value) {
             this.testValue = value;
             }
            
             public String getTestValue() {
             return testValue;
             }
            
             private String testValue;
            }


            Deploy and run the app in JBoss 4.2.0.GA. Do not enter anything into the input field and click the "Dummy" link. You'll see the red div box (minus contexts) inserted at the top of the "Artists & Discs" panel; The Dummy link will also be duplicated. Hit Dummy again to add more instances.

            • 3. Re: Crazy rendering after validation error (post 4.2 upgrade
              Brian Smith Apprentice

              I have been able to reproduce this exactly as described.