5 Replies Latest reply on Feb 23, 2009 8:44 PM by nohacks

    JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID

      Hi All,

      I have been working on this error. It seems to happen when my tomcat server times out. It forwards to the right page from web.xml.

      <error-page>
      <exception-type>javax.faces.application.ViewExpiredException</exception-type>
      <location>/errorTimeOut.jsp</location>
      </error-page>

      <error-page>
      <exception-type>java.lang.Exception</exception-type>
      <location>/errorTimeOut.jsp</location>
      </error-page>


      I just get this error in my logs...

      Feb 22, 2009 8:38:43 PM com.sun.faces.lifecycle.Phase doPhase
      SEVERE: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /memberEmailReceived.jsp) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@1f14fd]
      2009-02-22 20:38:43,846 ERROR org.ajax4jsf.webapp.BaseXMLFilter org.ajax4jsf.webapp.BaseXMLFilter doXmlFilter - Exception in the filter chain
      javax.servlet.ServletException
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
       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:154)
       at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:265)
       at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:376)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:503)
       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.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
       at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
       at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
       at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
       at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NullPointerException
       at com.myAppName.java.beansTable.EmailReceivedBeanTest.<init>(Unknown Source)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at java.lang.Class.newInstance0(Class.java:355)
       at java.lang.Class.newInstance(Class.java:308)
       at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186)
       at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:106)
       at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:368)
       at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:230)
       at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:88)
       at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
       at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
       at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:61)
       at org.apache.el.parser.AstValue.getValue(AstValue.java:107)
       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:609)
       at org.ajax4jsf.component.UIDataAdaptor.getValue(UIDataAdaptor.java:1641)
       at org.ajax4jsf.component.SequenceDataAdaptor.getDataModel(SequenceDataAdaptor.java:48)
       at org.ajax4jsf.component.SequenceDataAdaptor.createDataModel(SequenceDataAdaptor.java:42)
       at org.ajax4jsf.component.UIDataAdaptor.getExtendedDataModel(UIDataAdaptor.java:622)
       at org.ajax4jsf.component.UIDataAdaptor.getRowCount(UIDataAdaptor.java:249)
       at org.richfaces.component.UIDatascroller.getRowCount(UIDatascroller.java:343)
      
       at org.richfaces.component.UIDatascroller.getRowCount(UIDatascroller.java:343)
       at org.richfaces.component.UIDatascroller.getPageCount(UIDatascroller.java:318)
       at org.richfaces.component.UIDatascroller.getPageCount(UIDatascroller.java:339)
       at org.richfaces.renderkit.html.DatascrollerTemplate.doEncodeEnd(DatascrollerTemplate.java:203)
       at org.richfaces.renderkit.html.DatascrollerTemplate.doEncodeEnd(DatascrollerTemplate.java:673)
       at org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:135)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861)
       at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
       at org.richfaces.renderkit.AbstractRowsRenderer.encodeCellChildren(AbstractRowsRenderer.java:285)
       at org.richfaces.renderkit.AbstractRowsRenderer.encodeTableHeaderFacet(AbstractRowsRenderer.java:307)
       at org.richfaces.renderkit.AbstractGridRenderer.encodeFooter(AbstractGridRenderer.java:58)
       at org.richfaces.renderkit.html.DataGridRenderer.doEncodeBegin(DataGridRenderer.java:196)
       at org.richfaces.renderkit.html.DataGridRenderer.doEncodeBegin(DataGridRenderer.java:148)
       at org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:101)
       at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
       at javax.faces.component.UIData.encodeBegin(UIData.java:962)
       at org.ajax4jsf.component.UIDataAdaptor.encodeBegin(UIDataAdaptor.java:1221)
       at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:280)
       at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
       at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:220)
       at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:215)
       at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
       at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
       at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:271)
       at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:202)
       at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:191)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
       at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
       ... 21 more
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
       ... 21 more
      Feb 22, 2009 8:38:43 PM org.apache.catalina.core.StandardWrapperValve invoke
      SEVERE: Servlet.service() for servlet Faces Servlet threw exception
      java.lang.NullPointerException
       at com.myAppName.java.beansTable.EmailReceivedBeanTest.<init>(Unknown Source)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at java.lang.Class.newInstance0(Class.java:355)
       at java.lang.Class.newInstance(Class.java:308)
       at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186)
       at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:106)
       at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:368)
       at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:230)
       at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:88)
       at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
       at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
       at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:61)
       at org.apache.el.parser.AstValue.getValue(AstValue.java:107)
       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:609)
       at org.ajax4jsf.component.UIDataAdaptor.getValue(UIDataAdaptor.java:1641)
       at org.ajax4jsf.component.SequenceDataAdaptor.getDataModel(SequenceDataAdaptor.java:48)
       at org.ajax4jsf.component.SequenceDataAdaptor.createDataModel(SequenceDataAdaptor.java:42)
       at org.ajax4jsf.component.UIDataAdaptor.getExtendedDataModel(UIDataAdaptor.java:622)
       at org.ajax4jsf.component.UIDataAdaptor.getRowCount(UIDataAdaptor.java:249)
       at org.richfaces.component.UIDatascroller.getRowCount(UIDatascroller.java:343)
       at org.richfaces.component.UIDatascroller.getPageCount(UIDatascroller.java:318)
       at org.richfaces.component.UIDatascroller.getPageCount(UIDatascroller.java:339)
       at org.richfaces.renderkit.html.DatascrollerTemplate.doEncodeEnd(DatascrollerTemplate.java:20


        • 1. Re: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID

          I found this...

          Did anyone hear of this issue??

          http://www.coderanch.com/t/430764/JSF/java/Not-Session-Timeout-but-throw
          


          Abstract from FAQs about Mojarra (Sun's JSF implementation):

          * com.sun.faces.numberOfViewsInSession - Defaults to 15. This parameter defines the maximum number of JSF views stored in the session for per logical view. The map used to store the views uses an LRU algorithm to keep the map from growing beyond the configured value.
          * com.sun.faces.numberOfLogicalViews - Defaults to 15. This parameter defines the maximum number of logical views to store per session. The map used to store the logical views uses an LRU algorighm to keep the map from growing beyone the configured value.

          A comment on the numberOfXXX parameters. Logical views are best defined as top level view that may have one or more actual views inside of it. A new logical view entry will be created any time a GET occurs (a new request, a frameset, two browser windows...). The value of this logical entry is another Map that will be used to store the view information (i.e. the structure and state). As a user progresses through an application using standard JSF navigation mechanisms, additional view state will be added to the Map associated with a single logical view.

          As an example, using the jsf-guessNumber application.

          * First request results in a state marker value of j_id1:j_id2. j_id1 represents the logical view, and j_id2 represents the actual view state.
          * Next, enter a guess. The new state marker value is j_id1:j_id3 - again j_id1 being the logical view, and j_id3 being the actual view. So at this point, the Map associated with logical view j_id1 has two entries, j_id2, and i_id3.
          * Next, click the Back button, and the new marker is j_id1:j_id4.
          * Now, issue a request to the context root of the application and notice that the state marker has now changed to j_id5:j_id6. As stated above, each GET will cause a new logical entry to be created. At this point, there are two logical Maps, j_id1 and j_id5. Logical Map j_id1, has three entries, j_id2, j_id3, and j_id4. Logical Map j_id5, has a single entry, j_id6.


          The follow content is my understanding:

          It means that a new actual view state will be created when POST request, and a new logical view entry will be create when GET request.

          A logical view entry will store more than one actual view state, so we should increase the value of com.sun.faces.numberOfViewsInSession when there would be many POST request(AJAX request implemented by richfaces/ajax4jsf) in one form.

          For example , for our web application, in one form, there are many ajax request for retrieve data for many fields, so these ajax requests will cause many POST requests and results in many view state to be created.
          And in one form, there saves a view state id by <input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id2" />, this id represent a view state stored in session. Because many new view states were created before and the map used to stored view states uses an LRU algorithm, the view state specified by the view state id would be so likely to be removed from session. So when the user fill in all data completely and submit the form, system can not restore the view state specified by the submitted id at last, and then throw ViewExpiredException.

          If there are some mistake, please point out for me

          thank you very much!


          Thanks for any help.
          Phil


          • 2. Re: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID
            nbelaevski

            Hi Phil,

            Once again, there's the problem in your application code: java.lang.NullPointerException
            at com.myAppName.java.beansTable.EmailReceivedBeanTest.(Unknown Source)

            On the question concerning stored views state: RF contains a special implementation of state manager that's specialized behavior is that it reuses old state id for AJAX requests, so that configured number of logical views have nothing common with how many AJAX requests were executed.


            • 3. Re: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID

               

              "nbelaevski" wrote:
              Hi Phil,

              Once again, there's the problem in your application code: java.lang.NullPointerException
              at com.myAppName.java.beansTable.EmailReceivedBeanTest.<init>(Unknown Source)

              On the question concerning stored views state: RF contains a special implementation of state manager that's specialized behavior is that it reuses old state id for AJAX requests, so that configured number of logical views have nothing common with how many AJAX requests were executed.


              Hi nbelaevski,
              Thanks for your quick response..

              I found this page and they seem to be having the same issue. I put this in my web.xml.

              http://blog.maaloe.com/2008/10/jsf-how-to-get-rid-of-jsf1054-phase-id.html


              <context-param>
               <param-name>com.sun.faces.enableRestoreView11Compatibility</param-name> <param-value>true</param-value>
               </context-param>


              This did not help..

              I found lots of posts of Richfaces and jsf1054. None seemed to answer the problem. There is also a jira issue listed too...but I dont know if that is what I am running into...

              https://jira.jboss.org/jira/browse/RF-1270




              You have mentioned several times it is in my code. When the application times out from anywhere the app gets this response. The application is large so you are saying in every bean I need to check for timeout ?

              I do have a header.jsp that I check for session active. It crashes before I get to that <% part of jsp.

              Thanks
              Phil






              • 4. Re: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID
                nbelaevski

                https://jira.jboss.org/jira/browse/RF-1270 is about portals, I do not see any references to portals in stack trace you've posted. Are you running portlet environment?

                Please try to configure empty page (JSP taglib declarations + some text and no JSF components) and set it as error page. Will you still experience the issue?

                Another guess: there can be something wrong with managed beans, so when new set of faces-config.xml beans is created after session expiration, something is going wrong.

                I suggest that you recompile your beans with "lines" debug option and then check what's failing with NPE.

                • 5. Re: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID

                   

                  "nbelaevski" wrote:

                  Please try to configure empty page (JSP taglib declarations + some text and no JSF components) and set it as error page. Will you still experience the issue?


                  I found some interesting results...

                  I created a blank jsp page. Then let the tomcat session timeout. The page goes to tomcat index.html page. No Errors are posted in the catalina.out..but the login page needs to be reloaded.

                  The blank jsp page does not forward to the jsp errorTimeOut.jsp.

                  When I go to a jsp page with a bean after a session timeout..it forwards to the correct errorTimeOut.jsp but logs an error in the catalina.out.

                  Any Help ?

                  Phil