Viewexpiredexception in view periodically updated

Asked

Viewed 366 times

0

Good morning. I am with a periodically updated view which throws the following exception:

Nov 03, 2015 11:21:49 AM com.sun.faces.context.AjaxExceptionHandlerImpl handlePartialResponseError
GRAVE: javax.faces.application.ViewExpiredException: viewId:/restrito/principal.xhtml - A exibição de /restrito/principal.xhtml não pôde ser restaurada.
    at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:210)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:121)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at br.com.hidros.control.filter.PageFilter.doFilter(PageFilter.java:38)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)

View

<?xml version="1.0" encoding="ISO-8859-1"?>  
<ui:composition 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui" 
    xmlns:h="http://java.sun.com/jsf/html"
    template="/resources/template/template_restrito.xhtml">

    <ui:define name="css">
        <h:outputStylesheet library="css" name="restrito.css"/>
    </ui:define>

    <ui:define name="content">
        <div id="content">       

            <h:form id="form">      
               <br />
               <center><h:outputLabel value="Tela do Gestor" class="titlePrincipal" /></center>

               <p:poll interval="#{controleBean.ciclo}" update="refreshArea" />
               <p:panel id="refreshArea" style="border:0px;">
                    <ui:repeat var="abr" value="#{controleBean.auxiliarbr}" varStatus="status">
                        <p:panel class="containerBomba" title="Descrição" id="desc">
                            <div class="reservatorio reservatorio#{controleBean.verificarNivelReservatorio()}" title="Reservatório">
                                <h:outputText value="#{abr.reservatorio.nomeReservatorio}" />
                                <h:outputText value="(#{controleBean.verificarNivelReservatorio()}%)" rendered="#{!controleBean.verificarNivelReservatorio().equalsIgnoreCase('defeito')}" />
                            </div>

                            <ui:repeat var="b" value="#{abr.bombas}" varStatus="status2">
                                <div class="bomba bomba#{controleBean.verificarEstadoBomba(b)}" title="Bomba">
                                    <h:outputText value="#{b.nomeBomba}" />
                                </div> 
                            </ui:repeat>
                        </p:panel>                      

                        <p:overlayPanel id="panel" for="desc" showEffect="blind" tableStyle="width:auto"
                            hideEffect="explode" showEvent="mouseover" onShow="#{controleBean.prepararPreview(status.index)}"
                            hideEvent="mousedown" dismissable="false" showCloseIcon="true" style="width:17%;">

                            <p:panelGrid styleClass="semBorda">
                                <p:row><p:column><h:outputText style="font-size:70%" value="Reservatório: #{controleBean.abr.reservatorio.nomeReservatorio}" /></p:column></p:row>
                                <p:row><p:column><h:outputText style="font-size:70%" value="Capacidade: #{controleBean.abr.reservatorio.capacidadeReservatorio} Lts." /></p:column></p:row>
                                <p:row><p:column><h:outputText style="font-size:70%" value="Tipo: #{controleBean.abr.reservatorio.tipoReservatorio}" /></p:column></p:row>
                                <p:row><p:column><h:outputText style="font-size:70%" value="Volume Atual: #{controleBean.abr.volumeAtual} Lts." /></p:column></p:row>
                                <p:row><p:column><h:outputText style="font-size:70%" value="Temperatura da Placa: 20°C" /></p:column></p:row>

                                <p:row><p:column/></p:row>                              

                                <p:row> <p:column>                              
                                    <p:dataTable var="b" style="font-size:70%;"
                                        value="#{controleBean.abr.bombas}"
                                        rows="4" emptyMessage="Nenhuma Bomba conectada">

                                        <p:column headerText="Nome" style="font-size:70%;">
                                            <h:outputText value="#{b.nomeBomba}" style="font-size:100%;"/>
                                        </p:column>

                                        <p:column headerText="Status" style="font-size:70%;">
                                            <h:outputText value="#{controleBean.verificarEstadoBomba(b)}" style="font-size:100%;"/>
                                        </p:column>                 
                                    </p:dataTable>
                                </p:column> </p:row>
                            </p:panelGrid>
                        </p:overlayPanel>
                    </ui:repeat>
                </p:panel>              
            </h:form>
        </div>
    </ui:define>            
</ui:composition>

In this view I have a <p:poll/> that updates my refreshArea in seconds cycle intervals (cycle = 5 in my Managedbean).

I did a lot of research and found a Devmedia link teaching how to work with Session and Filter, implemented based on example, but it didn’t do much good.

  • The view is displayed the first time it is loaded or already starts with the error?

  • It is displayed the first time and then launches. Although it continues, over time, the components remain unresponsive. As it keeps on updating itself, the exception keeps being thrown over and over again.

  • I’m going to work now. Getting there, I see calmly.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.