13 Replies Latest reply on Dec 14, 2012 2:09 AM by a.zhemoytuk

    Facelets exception in RF 4.2.1

    true_mykola

      Since RF 4.2.1 CR1 (4.2.1.Final didn't fix it) i get this exception almost on all pages:

      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
      

      With RF 4.2.0 everything works fine. What is this?

        • 1. Re: Facelets exception in RF 4.2.1
          bek816

          We are seeing the same problem when we upgraded to RichFaces 4.2.1 this morning.  We have a page witth a lot of tabs and nested tabs.  It works with 4.2.0, but not 4.2.1. 

          • 2. Re: Facelets exception in RF 4.2.1
            bek816

            We are using Sun Java Faces 2.1.7

            • 3. Re: Facelets exception in RF 4.2.1
              healeyb

              I think it's safe to say that many people aren't getting this problem (myself included thankfully) so perhaps you

              should provide additional info about your environment, looks like you're on WebLogic.

              • 4. Re: Facelets exception in RF 4.2.1
                true_mykola

                Yes, I'm on Weblogic 10.3.5, JSF 2.0.4 (which is supplied with this version of weblogic), Openfaces 3.1 (nightly) and RF 4.2.0 (which work correctly) or RF 4.2.1 (which cause the exception above).

                • 5. Re: Facelets exception in RF 4.2.1
                  bek816

                  We are using Tomcat 7.

                  • 6. Re: Facelets exception in RF 4.2.1
                    a.zhemoytuk

                    The problem is reproducible on postback when outputPanel has child text(html) nodes.

                    E.g.:

                     

                    <a:outputPanel>

                          <span></span>

                    </a:outputPanel>

                     

                    Update:

                    In RichFaces 4.2.1.Final default value for keepTransient attribute of outputPanel changed, refer to org.richfaces.component.AbstractOutputPanel:

                     

                    @Attribute(defaultValue= "true")

                    public abstract boolean isKeepTransient();

                     

                    In RichFaces 4.2.0.Final default value was 'false'.

                     

                    So, during encoding - all children of UIOutputPanel are set as non-transient (even nodes of UIInstructions type).

                     

                     

                    Workaround:

                     

                    public class UIOutputPanelWorkaround extends UIOutputPanel

                    {

                      public boolean isKeepTransient() {

                        Boolean value = (Boolean) getStateHelper().eval(Properties.keepTransient, false);

                        return value;

                      }

                    }

                    and in faces-config:

                      <component>

                        <component-type>org.richfaces.OutputPanel</component-type>

                        <component-class>com.example.UIOutputPanelWorkaround</component-class>

                      </component>

                    • 7. Re: Facelets exception in RF 4.2.1
                      true_mykola

                      Maybe you're right but i've failed to reproduce it on simple page with a4j:outputPanel and child text nodes. Nevertheless i want to try your workaround but i've faced a strange problem with getStateHelper() method because i get this error: "The method getStateHelper() is undefined for the type UIOutputPanelWorkaround". Though i can see that it's used all over UIOutputPanel i couldn't find its implementation neither in UIOutputPanel nor in any of its parent classes. How to fix it? Can i return just false?

                      • 8. Re: Facelets exception in RF 4.2.1
                        a.zhemoytuk

                        The method is in JSF class:

                        javax.faces.component.UIComponent#getStateHelper

                        I guess you need to add compile time dependency on jsf library.

                        And yes, you can just return false untill you want to set that keepTransient attribute from outside.

                         

                        To reproduce the issue a postback is needed. E.g. as following (button needs to be clicked for error to appear):

                        <h:form>

                            <a4j:outputPanel>

                                <span></span>

                            </a4j:outputPanel>

                            <a4j:commandButton value="Click me"/>

                        </h:form>

                         

                        The issue is reproducible also for RichFaces before 4.2.1.Final when keepTransient attribute explicitly set to true.

                        1 of 1 people found this helpful
                        • 9. Re: Facelets exception in RF 4.2.1
                          true_mykola

                          I've just noticed that i tested it with 4.2.0 library not 4.2.1 or 4.2.2, so it's not surprising that everything worked fine. Now i can reproduce it even without any child nodes . I created bug in JIRA, correct it if something's wrong.

                          And thanks for workaround!

                          • 10. Re: Facelets exception in RF 4.2.1
                            luisaggo

                            I have the RichFaces V4.2.3.Final, JSF Mojarra 2.1.14 and PrimeFaces 3.4.2 the error is the same!!! When I update to RF V4.2.0 the error change to:

                             

                            java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
                            at java.util.ArrayList.RangeCheck(ArrayList.java:547)
                            at java.util.ArrayList.get(ArrayList.java:322)
                            at javax.faces.component.AttachedObjectListHolder.restoreState(AttachedObjectListHolder.java:165)
                            at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1560)
                            at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1336)
                            at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1351)
                            at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1351)
                            at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1351)
                            at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1351)
                            at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1351)
                            at javax.faces.component.UIViewRoot.processRestoreState(UIViewRoot.java:876)
                            at com.sun.faces.application.view.JspStateManagementStrategy.restoreView(JspStateManagementStrategy.java:270)
                            at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:141)
                            at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)
                            at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:531)
                            at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:141)
                            at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:345)
                            at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:301)
                            at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:192)
                            at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
                            at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
                            at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                             

                             

                            In the first case when RF version is 4.2.3 the backing bean action executes but with RF version 4.2.0 not execute action in Backing Bean. Please any idea??

                            • 11. Re: Facelets exception in RF 4.2.1
                              luisaggo

                              I have the RichFaces V4.2.3.Final, JSF Mojarra 2.1.14 and PrimeFaces 3.4.2 the error is the same!!! When I update to RF V4.2.0 the error change to:

                               

                              java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
                              at java.util.ArrayList.RangeCheck(ArrayList.java:547)
                              at java.util.ArrayList.get(ArrayList.java:322)
                              at javax.faces.component.AttachedObjectListHolder.restoreState(AttachedObjectListHolder.java:165)
                              at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1560)
                              at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1336)
                              at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1351)
                              at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1351)
                              at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1351)
                              at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1351)
                              at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1351)
                              at javax.faces.component.UIViewRoot.processRestoreState(UIViewRoot.java:876)
                              at com.sun.faces.application.view.JspStateManagementStrategy.restoreView(JspStateManagementStrategy.java:270)
                              at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:141)
                              at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)
                              at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:531)
                              at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:141)
                              at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:345)
                              at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:301)
                              at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:192)
                              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
                              at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
                              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
                              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                               

                               

                              In the first case when RF version is 4.2.3 the backing bean action executes but with RF version 4.2.0 not execute action in Backing Bean. Please any idea??

                              • 12. Re: Facelets exception in RF 4.2.1
                                luisaggo

                                When I Defined the solution that you post, the error change for this...

                                 

                                java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
                                at java.util.ArrayList.RangeCheck(ArrayList.java:547)
                                at java.util.ArrayList.get(ArrayList.java:322)
                                at javax.faces.component.AttachedObjectListHolder.restoreState(AttachedObjectListHolder.java:165)
                                at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1560)
                                at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1336)
                                at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1351)
                                at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1351)
                                at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1351)
                                at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1351)
                                at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1351)
                                at javax.faces.component.UIViewRoot.processRestoreState(UIViewRoot.java:876)

                                 

                                My RichFaces Version is 4.2.3Final and JSF is Mojarra 2.1.14. Please any idea?

                                • 13. Re: Facelets exception in RF 4.2.1
                                  a.zhemoytuk

                                  The problem with IndexOutOfBoundsException does not seem to be related to the issue described in this topic. I would recommend to create a new topic with more details how you get the problem, what is your xhtml code, etc.