5 Replies Latest reply on Jan 3, 2011 6:01 AM by franckoliver

    polling problem: view could not be restored

    franckoliver

      hi i'm new in seam and i'm trying to poll the server every 5000ms to update an image on my page. The page doesn t get refreshed automatically(i have to refresh the browser to see another image) and i get this error. 



      16:08:04,313 SEVERE [lifecycle] JSF1054: (Phase ID: RESTORE_VIEW 1, View ID: ) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@17becd8]
      16:08:04,453 ERROR [Exceptions] handled and logged exception
      javax.servlet.ServletException: viewId:/entsiegelung.seam - View /entsiegelung.seam could not be restored.
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:270)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           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:235)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
           at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.faces.application.ViewExpiredException: viewId:/entsiegelung.seam - View /entsiegelung.seam could not be restored.
           at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:185)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
           at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:103)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
           ... 43 more
      



      here is my code on the view:



      <h: graphicImage id="imlock" value="#{imbean.imLockURL}" style="height:200px; width:200px">     
          <a:poll reRender="imlock" interval="5000" enable="#{imbean.imLockURL}"/>
      </h: graphicImage> 
      




        • 1. Re: polling problem: view could not be restored
          lvdberg

          Hi,


          try something like this:



          .. Must be inside a form !!!!
          ...
          <a:poll reRender="imlock" interval="5000" />
          <a:outputPanel id="imlock" >
          <h: graphicImage value="#{imbean.imLockURL}" style="height:200px; width:200px" />     
          </a:outputPanel>
          ...
          




          Leo


          P.S: Be aware that you need additional ajax attributes to make it fail safe, especially when you have more ajax on your page!

          • 2. Re: polling problem: view could not be restored
            franckoliver

            hi, thanks for your reply. I put my image in a form and it works, however i got it just one time refreshed on the browser. Do you have an idea what's happen or how i can fix the problem? I have two more ajax on my page, what kind of ajax attributes do you mean?


            thanks for your help. 


            • 3. Re: polling problem: view could not be restored
              lvdberg

              Hi,


              It seems that you're reRendering the whole page with each timeout, because you just want to partial reRender. I added an example in my previous answer, because I don't think you should put the ajax tag inside the image tag (I think that's the reason it doesn't work. The ajax tags have a full set of ajax-attributes to make its use fail-safe. The Rich-faces documentation contains a whole chapter about the subject and also the Rich-demo site contains an explanation about the attributes.


              Keep in mind that Ajax has its benefits, but it comes with a price: It tries to solve almost insolvable HTTP restrictions, so if you don't define the tags carefully it will prodce very difficult to debug errors.


              Look especially at:


              a:outputPanel in combination with a:region and define a (global) queue, configure eventsQueue to link to that queue, use the limitToList and use time outs etc.


              Leo


              .

              • 4. Re: polling problem: view could not be restored
                franckoliver

                thanks for your help. I've put the ajax tag inside the image tag and it works now.

                • 5. Re: polling problem: view could not be restored
                  franckoliver

                  just ignore the previous post!!!