Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-12295

Facelets exception on postback when partial state saving is off

    XMLWordPrintable

    Details

    • Sprint:
      4.3.0.M2 sprint 1
    • Story Points:
      1
    • Steps to Reproduce:
      Hide

      create page with a4j:outputPanel and some button or another component that will trigger some action:

      <h:form>
          <a4j:outputPanel>
              <span></span>
          </a4j:outputPanel>
          <a4j:commandButton value="Click me"/>
      </h:form>
      
      web.xml
      ...
      <context-param>
          <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
          <param-value>false</param-value>
      </context-param>
      ...
      
      Show
      create page with a4j:outputPanel and some button or another component that will trigger some action: <h:form> <a4j:outputPanel> <span></span> </a4j:outputPanel> <a4j:commandButton value= "Click me" /> </h:form> web.xml ... <context-param> <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name> <param-value> false </param-value> </context-param> ...
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      (By Andrey Zhemoytuk)
      Create class that extends UIOutputPanel and override its isKeepTransient() method:

      public class UIOutputPanelWorkaround extends UIOutputPanel
      {
        public boolean isKeepTransient() {
          // or just return false;
          Boolean value = (Boolean) getStateHelper().eval(Properties.keepTransient, false);
          return value;
        }
      }
      

      and in faces-config:

        <component>
          <component-type>org.richfaces.OutputPanel</component-type>
          <component-class&gt;com.example.UIOutputPanelWorkaround</component-class&gt;
        </component>
      
      Show
      (By Andrey Zhemoytuk) Create class that extends UIOutputPanel and override its isKeepTransient() method: public class UIOutputPanelWorkaround extends UIOutputPanel { public boolean isKeepTransient() { // or just return false ; Boolean value = ( Boolean ) getStateHelper().eval(Properties.keepTransient, false ); return value; } } and in faces-config: <component> <component-type>org.richfaces.OutputPanel</component-type> <component- class& gt;com.example.UIOutputPanelWorkaround</component- class& gt; </component>

      Description

      Facelets exception occurs on postback phase if there's <a4j:outputPanel> on the page. After this exception further work is not possible as it prevents all other actions. On Richfaces 4.2.0 and older exception doesn't occur. Exception text:

      javax.faces.FacesException: java.lang.InstantiationException: com.sun.faces.facelets.compiler.UIInstructions
          at com.sun.faces.application.StateManagerImpl.newInstance(StateManagerImpl.java:290)
          at com.sun.faces.application.StateManagerImpl.restoreTree(StateManagerImpl.java:315)
          at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:192)
          at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:119)
          at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:444)
          at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:144)
          at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:284)
          at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:183)
          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
          at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:107)
          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
          at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
          at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
          at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
          at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
          at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
          at util.servlet.filter.NoCacheFilter.doFilter(NoCacheFilter.java:33)
          at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
          at util.servlet.filter.EncodingFilter.doFilter(EncodingFilter.java:26)
          at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
          at weblogicx.servlet.gzip.filter.GZIPFilter.doFilter(GZIPFilter.java:70)
          at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
          at util.servlet.filter.AuthFilter.doFilter(AuthFilter.java:79)
          at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
          at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
          at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
          at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
          at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
          at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
          at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
          at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
          at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
          at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
          at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
          at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
      Caused by: java.lang.InstantiationException: com.sun.faces.facelets.compiler.UIInstructions
          at java.lang.Class.newInstance0(Class.java:340)
          at java.lang.Class.newInstance(Class.java:308)
          at com.sun.faces.application.StateManagerImpl.newInstance(StateManagerImpl.java:285)
          ... 35 more
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  michpetrov Michal Petrov
                  Reporter:
                  true_mykola Nikolai Alexeev
                • Votes:
                  7 Vote for this issue
                  Watchers:
                  12 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: