Pessoal estou com um problema na DataTable do prime.
Quando uso a tag update da tabela gera o seguinte erro :
javax.faces.FacesException: Unexpected error restoring state for component with id j_idt3. Cause: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0.
at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:273)
at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:151)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1485)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1496)
at com.sun.faces.component.visit.VisitUtils.doFullNonIteratingVisit(VisitUtils.java:75)
at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:257)
at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:181)
at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:448)
at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:148)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:187)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:111)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at javax.faces.component.AttachedObjectListHolder.restoreState(AttachedObjectListHolder.java:165)
at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1432)
at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:265)
... 29 more
meu código cadastroCliente.xhtml
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Cadastro de Clientes</title>
</h:head>
<h:body>
<h:form id="frmGridCliente">
<p:growl id="menssagensCliente"
life="3000"/>
<p:dataTable widgetVar="dtClientes"
var="cliente"
value="#{mbCliente.clientes}"
paginator="true"
rows="5"
selection="#{mbCliente.cliente}"
selectionMode="single"
emptyMessage="Nao existe cliente cadastrado"
style="width:70%"
update="pnlBotoes">
<p:column sortBy="#{cliente.id}"
filterBy="#{cliente.id}"
style="width:20%">
<f:facet name="header">
<h:outputText value="Id" />
</f:facet>
<h:outputText value="#{cliente.id}" />
</p:column>
<p:column sortBy="#{cliente.nome}"
filterBy="#{cliente.nome}">
<f:facet name="header">
<h:outputText value="Nome" />
</f:facet>
<h:outputText value="#{cliente.nome}" />
</p:column>
<p:column sortBy="#{cliente.cnpj}"
filterBy="#{cliente.cnpj}">
<f:facet name="header">
<h:outputText value="Cnpj" />
</f:facet>
<h:outputText value="#{cliente.cnpj}" />
</p:column>
</p:dataTable>
<p:panel style="width:69.2%" id="pnlBotoes">
<p:commandLink title="Novo"
oncomplete="dlgCliente.show();"
action="#{mbCliente.novo}"
update="frmCadastroCliente"
style="margin-right:20px">
<h:graphicImage url="/imagens/novo.jpg"
style="border:0"/>
</p:commandLink>
<p:commandLink title="Alterar"
oncomplete="dlgCliente.show();"
style="margin-left:20px"
update="frmCadastroCliente"
disabled="#{empty mbCliente.cliente.id}">
<p:graphicImage url="/imagens/alterar.jpg"
style="border:0"/>
</p:commandLink>
<p:commandLink title="Apagar"
actionListener="#{mbCliente.apagar}"
style="margin-left:20px"
update="frmGridCliente"
disabled="#{empty mbCliente.cliente.id}">
<p:graphicImage url="/imagens/apagar.jpg"
style="border:0"/>
</p:commandLink>
<p:commandLink title="Voltar"
action="#{mbCliente.voltar}"
ajax="false"
style="margin-left:20px">
<h:graphicImage url="/imagens/voltar.jpg"
style="border:0"/>
</p:commandLink>
</p:panel>
</h:form>
<h:form id="frmCadastroCliente">
<p:dialog id="dlgCliente"
widgetVar="dlgCliente"
header="Cliente"
width="500">
<h:panelGrid columns="2" id="pnl" >
<h:outputLabel value="Id"
for="itxId"
rendered="#{!empty mbCliente.cliente.id}"/>
<p:inputText id="itxId"
value="#{mbCliente.cliente.id}"
disabled="true"
rendered="#{!empty mbCliente.cliente.id}"/>
<h:outputLabel value="Nome"
for="itxNome" />
<p:inputText id="itxNome"
value="#{mbCliente.cliente.nome}"
size="35"/>
<h:outputLabel value="CNPJ"
for="itxCnpj" />
<p:inputText id="itxCnpj"
value="#{mbCliente.cliente.cnpj}"/>
</h:panelGrid>
<h:panelGrid columns="3">
<h:commandLink title="Gravar"
action="#{mbCliente.gravar}"
rendered="#{empty mbCliente.cliente.id}"
update="menssagensCliente, itxId, itxCnpj, itxNome, frmGridCliente">
<p:graphicImage url="/imagens/gravar.jpg"
style="border:0"/>
</h:commandLink>
<p:commandLink title="Gravar"
actionListener="#{mbCliente.alterar}"
rendered="#{!empty mbCliente.cliente.id}"
oncomplete="dlgCliente.hide();"
update="menssagensCliente, itxId, itxCnpj, itxNome, frmGridCliente">
<p:graphicImage url="/imagens/gravar.jpg"
style="border:0"/>
</p:commandLink>
</h:panelGrid>
</p:dialog>
</h:form>
</h:body>
</html>
ISSO esta afetando varios pontos no meu sistema
Alguem sabe o que pode ser?