I have written a webdriver test for my page, which tests a primefaces wizard component and behavior. At one point, I get this error :
java.lang.NullPointerException
at org.primefaces.component.wizard.WizardRenderer.encodeStep(WizardRenderer.java:77)
at org.primefaces.component.wizard.WizardRenderer.encodeEnd(WizardRenderer.java:59)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:517)
at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1612)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
at javax.faces.component.UIForm.visitTree(UIForm.java:362)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:378)
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:298)
at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)
at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)
at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)
at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:982)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:411)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:124)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.meinanliegen.handlers.filters.NoCacheFilter.doFilter(NoCacheFilter.java:42)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.omnifaces.filter.FacesExceptionFilter.doFilter(FacesExceptionFilter.java:56)
at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.omnifaces.filter.GzipResponseFilter.doFilter(GzipResponseFilter.java:148)
at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.omnifaces.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:115)
at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1812)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
My primefaces wizard looks like :
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<p:growl id="growl" autoUpdate="true" life="6000" showDetail="true" />
<h:form prependId="false" style="height : 100%" id="registrationFormWizardId">
<f:view beforePhase="#{userRegistrationWizard.afterPhase}">
</f:view>
<p:panel id="registrationFormWizardPanelGrid">
<p:panelGrid>
<p:row>
<p:column>
<p:wizard widgetVar="wiz" flowListener="#{userRegistrationWizard.onFlowProcess}"
step="#{userRegistrationWizard.step}" backLabel="Zurück" nextLabel="Weiter">
<p:tab id="idOne" title="TITLE1">
<ui:include src="/WEB-INF/templates/steps/registration_step1.xhtml"></ui:include>
</p:tab>
<p:tab id="idTwo" title="TITLE2">
<ui:include src="/WEB-INF/templates/steps/registration_step2.xhtml"></ui:include>
</p:tab>
<p:tab id="idThree" title="TITLE3">
<ui:include src="/WEB-INF/templates/steps/registration_step3.xhtml"></ui:include>
</p:tab>
</p:wizard>
</p:column>
</p:row>
</p:panelGrid>
</p:panel>
</h:form>
Does someone knows why this exception is being thrown?
UPDATE :
I use Primefaces 3.5 and MyFaces 2.1.17
According to Java code of WizardRenderer id of tab that should be rendered is not found in wizard. This is probably consequence if your test somehow went back on first page, or next on last page.
Related
I'm facing an annoyng problem and i hope someone can help me.
I'm using JSF 2.0, Mojarra 2.0.9 and RichFaces 4.3.0_final.
Trying to add a Rich Faces Editor into a jspf page, but when the page is loaded i have the error below.
If i refresh the browser page the editor is displayed.
This is my jspf page that cause the error ("myEditorValue" is a java.lang.String):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:richext="http://java.sun.com/jsf/composite/richext"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<script>window.CKEDITOR_BASEPATH='#{request.contextPath}/org.richfaces.resources/javax.faces.resource/org.richfaces.ckeditor/';</script>
<h:panelGrid id="myPanel-main" rendered="#{myBean.rendered}" style="width: 100%;">
<h:form id="myPanel-form">
<rich:collapsiblePanel id="myPanel-loadCollapse" rendered="#{not myBean.loadDone}" header="My Header" style="width:100%;">
<h:graphicImage id="myPanel-loading" value="#{user.layout.ajaxLoadingBar}" style="text-align:center;" />
</rich:collapsiblePanel>
<h:panelGroup id="myPanel-data" rendered="#{myBean.loadDone}" layout="block">
<c:forEach var="proposal" items="#{myBean.clientHistoryKeySet}">
<rich:collapsiblePanel id="myPanel-loadDone" style="width:100%;" rendered="#{not empty myBean.clientHistory[proposal]}"
header="Header - #{proposal.id} - (#{proposal.stateproposal})" expanded="#{myBean.expandedSection}"
headerClass= "#{myBean.selectedProp == proposal.id ? myBean.highlightHeader : ''}">
<h:panelGrid id="myPanel-history" columns="8" style="width: 100%;text-align:center;">
<h:panelGroup style="float:center">
<h:outputText value="#{user.message.MSG_ID_1" style="text-align:center;font-size:120%" class = "headerField"></h:outputText>
</h:panelGroup>
<h:panelGroup style="float:center">
<h:outputText value="#{user.message.MSG_ID_2}" style="text-align:center;font-size:120%" class = "headerField"></h:outputText>
</h:panelGroup>
<h:panelGroup style="float:center">
<h:outputText value="#{user.message.MSG_ID_3}" style="text-align:center;font-size:120%" class = "headerField"></h:outputText>
</h:panelGroup>
<h:panelGroup style="float:center">
<h:outputText value="#{user.message.MSG_ID_4}" style="text-align:center;font-size:120%" class = "headerField"></h:outputText>
</h:panelGroup>
<h:panelGroup style="float:center">
<h:outputText value="#{user.message.MSG_ID_5}" style="text-align:center;font-size:120%" class = "headerField"></h:outputText>
</h:panelGroup>
<h:panelGroup style="float:center">
<h:outputText value="#{user.message.MSG_ID_6}" style="text-align:center;font-size:120%" class = "headerField"></h:outputText>
</h:panelGroup>
<h:panelGroup style="float:center">
<h:outputText value="#{user.message.MSG_ID_7}" style="text-align:center;font-size:120%" class = "headerField"></h:outputText>
</h:panelGroup>
<h:panelGroup style="float:center">
<h:outputText value="#{user.message.MSG_ID_8}" style="text-align:center;font-size:120%" class = "headerField"></h:outputText>
</h:panelGroup>
<c:forEach var="dat" items="#{myBean.clientHistory[proposal]}">
<h:panelGroup style="float:center">
<h:graphicImage url= "#{dat.pathColor}" width="45%" height="45%" />
</h:panelGroup>
<h:panelGroup style="float:center">
<h:outputText value="#{dat.date1}" style="text-align:center;font-size:120%;"></h:outputText>
</h:panelGroup>
<h:panelGroup style="float:center">
<h:outputText value="#{dat.amount1}" style="text-align:center;font-size:120%;"></h:outputText>
</h:panelGroup>
<h:panelGroup style="float:center">
<h:outputText value="#{dat.date2}" style="text-align:center;font-size:120%;"></h:outputText>
</h:panelGroup>
<h:panelGroup style="float:center">
<h:outputText value="#{dat.date3}" style="text-align:center;font-size:120%;"> </h:outputText>
</h:panelGroup>
<h:panelGroup style="float:center">
<h:outputText value="#{dat.amount2}" style="text-align:center;font-size:120%;"></h:outputText>
</h:panelGroup>
<h:panelGroup style="float:center">
<h:outputText value="#{dat.figure}" style="text-align:center;font-size:120%;"></h:outputText>
</h:panelGroup>
<h:panelGroup style="float:center">
<h:outputText value="#{dat.user}" style="text-align:center;font-size:120%;"></h:outputText>
</h:panelGroup>
</c:forEach>
</h:panelGrid>
<c:forEach var="dat" items="#{myBean.clientHistory[proposal]}">
<rich:collapsiblePanel id="myPanel-Editor" rendered="true" switchType="client"
header="Editor Commerciale" style="width:100%;" expanded="false">
<h:panelGroup id="myPanel-SaveEditor">
<a4j:commandLink action="#{dat.saveEditor}" style="margin-left:10px;text-decoration:none;"
onclick="this.style.display='none'" type="button" render="#this myPanel-SaveEditor" status="myPanel-SavingEditor">
<h:graphicImage value="/images/salva.gif"/>
<h:outputText value="Salva"
style="margin-left:10px;font-size:14px;line-height: 20px;color:#274449;font-weight:bold;vertical-align:bottom;" />
</a4j:commandLink>
<a4j:status name="myPanel-SavingEditor">
<f:facet name="start">
<h:graphicImage value="#{user.layout.ajaxLoadingBar}" style="z-index:1000;"/>
</f:facet>
</a4j:status>
<h:graphicImage rendered="#{dat.editorSaved}" style="margin-left:15px;" value="/images/imm_ok.gif"/>
</h:panelGroup>
<br /><br />
<rich:editor id="myEditor" value="#{dat.myEditorValue}" />
</rich:collapsiblePanel>
</c:forEach>
</rich:collapsiblePanel>
</c:forEach>
</h:panelGroup>
</h:form>
<a4j:jsFunction name="loadmyPanel" actionListener="#{myBean.load}" render="myPanel-form" execute="#this" immediate="true" />
<script type="text/javascript">loadmyPanel();</script>
</h:panelGrid>
</ui:composition>
Stacktrace:
javax.faces.FacesException: Unexpected error restoring state for component with id javax_faces_location_BODY. Cause: java.lang.ClassCastException: com.sun.faces.application.view.StateHolderSaver cannot be cast to [Ljava.lang.Object;.
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:1507)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1518)
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 javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
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:508)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at it.uniteam.timeojsf.util.ApplicationSessionExpiryFilter.doFilter(ApplicationSessionExpiryFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassCastException: com.sun.faces.application.view.StateHolderSaver cannot be cast to [Ljava.lang.Object;
at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1427)
at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:265)
... 41 more
javax.faces.FacesException: Unexpected error restoring state for component with id javax_faces_location_BODY. Cause: java.lang.ClassCastException: com.sun.faces.application.view.StateHolderSaver cannot be cast to [Ljava.lang.Object;.
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:1507)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1518)
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 javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
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:508)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at it.uniteam.timeojsf.util.ApplicationSessionExpiryFilter.doFilter(ApplicationSessionExpiryFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassCastException: com.sun.faces.application.view.StateHolderSaver cannot be cast to [Ljava.lang.Object;
at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1427)
at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:265)
... 41 more
giu 24, 2020 8:19:39 AM org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() for servlet [Faces Servlet] in context with path [/myApplication] threw exception [com.sun.faces.application.view.StateHolderSaver cannot be cast to [Ljava.lang.Object;] with root cause
java.lang.ClassCastException: com.sun.faces.application.view.StateHolderSaver cannot be cast to [Ljava.lang.Object;
at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1427)
at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:265)
at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:151)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1507)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1518)
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 javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
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:508)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at it.uniteam.timeojsf.util.ApplicationSessionExpiryFilter.doFilter(ApplicationSessionExpiryFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
This question already has an answer here:
java.lang.NullPointerException at org.primefaces.component.datatable.feature.FilterFeature.filter
(1 answer)
Closed 6 years ago.
I'm trying to make a table filter using Primefaces 5,
but the filtering dosn't occur and get the follow stack:
java.lang.NullPointerException at
org.primefaces.component.datatable.feature.FilterFeature.filter(FilterFeature.java:136)
at
org.primefaces.component.datatable.feature.FilterFeature.encode(FilterFeature.java:105)
at
org.primefaces.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:77)
at
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1903)
at
com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:559)
at
com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183)
at org.primefaces.component.api.UIData.visitTree(UIData.java:692) at
javax.faces.component.UIComponent.visitTree(UIComponent.java:1740) at
javax.faces.component.UIComponent.visitTree(UIComponent.java:1740) at
com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:399)
at
com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:319)
at
org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:60)
at
javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:1004)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1896)
at
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:425)
at
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:301)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.star.AuthFilter.doFilter(AuthFilter.java:42) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
I'm cloning the primefaces showcase example but i'm not getting it right!
here is my code:
xhtml file:
<p:dataTable id="tbl" var="sim" value="#{simulationLog.simulation}"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
paginator="true" rows="10" style="margin-bottom:20px"
filteredValue="#{simulationLog.filtredSimulation}"
>
<p:column filterBy="#{sim.simId}" filterMatchMode="contains">
<f:facet name="header">
<h:outputText value="Id" />
</f:facet>
<p:commandLink value="#{sim.simId}" />
</p:column>
backing bean:
#ManagedBean
#SessionScoped
public class SimulationLog implements Serializable {
.
.
.
private List<SimulationLog> simulation;
private List<SimulationLog> filtredSimulation;
public List<SimulationLog> getSimulation() {
return ParamsDAO.getSimulation(codeAgence);
}
public List<SimulationLog> getFiltredSimulation() {
return filtredSimulation;
}
public void setFiltredSimulation(List<SimulationLog> filtredSimulation) {
this.filtredSimulation = filtredSimulation;
}
.
.
.
}
I had the same error and could fix it by wrapping the dataTable with a <h:form>.
In short, I had the following and was causing the same error:
<f:facet name="header">Date</f:facet>
<f:facet name="filter">
<h:outputText value="Year: " />
<p:selectOneMenu onchange="PF('myTable').filter();">
<f:selectItem itemValue="" itemLabel="All" />
<f:selectItems value="#{bean.conditionalYears}" var="yearSelect" itemValue="#{yearSelect.value}" itemLabel="#{yearSelect.label}" />
</p:selectOneMenu>
</f:facet>
I had to remove everything from <f:facet name="filter" /> except the <p:selectOneMenu />
In my case, the <h:outputText /> (not limited to outputText) was causing ClassCastException in FilterFeature:277 that were swallowed by UIData.visitTree(VisitContext, VisitCallback) (doesn't have CATCH)
filterValue = ((ValueHolder) filterFacet).getLocalValue();
For some reason, filterFacet is an UIPanel, not a SelectOneMenu as expected.
So, the answer is:
If you are using <f:facet name="filter" />, then try removing everything from it except your custom filter field.
I'm using JSF 2.2 and primefaces 4.0 with Mojarra 2.2.2 on a Tomcat server.
I'm using a p:datatable with a row editor, but whenever I try to edit a row I get the following error when press the "check" button to save the changes:
may 17, 2014 10:17:03 PM com.sun.faces.context.PartialViewContextImpl processPartial
Información: java.lang.NumberFormatException: null
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:454)
at java.lang.Integer.parseInt(Integer.java:527)
at org.primefaces.component.datatable.DataTable.queueEvent(DataTable.java:666)
at org.primefaces.behavior.ajax.AjaxBehaviorRenderer.decode(AjaxBehaviorRenderer.java:47)
at javax.faces.component.behavior.ClientBehaviorBase.decode(ClientBehaviorBase.java:132)
at org.primefaces.renderkit.CoreRenderer.decodeBehaviors(CoreRenderer.java:486)
at org.primefaces.component.datatable.DataTableRenderer.decode(DataTableRenderer.java:64)
at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:831)
at org.primefaces.component.api.UIData.processDecodes(UIData.java:246)
at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:550)
at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183)
at org.primefaces.component.api.UIData.visitTree(UIData.java:692)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at javax.faces.component.UIForm.visitTree(UIForm.java:371)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at javax.faces.component.UINamingContainer.visitTree(UINamingContainer.java:174)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:399)
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:263)
at org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:60)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:927)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
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:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2430)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2419)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
may 17, 2014 10:17:03 PM com.sun.faces.lifecycle.ApplyRequestValuesPhase execute
Advertencia: java.lang.NumberFormatException: null
javax.faces.FacesException: java.lang.NumberFormatException: null
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:270)
at org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:60)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:927)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
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:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2430)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2419)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:454)
at java.lang.Integer.parseInt(Integer.java:527)
at org.primefaces.component.datatable.DataTable.queueEvent(DataTable.java:666)
at org.primefaces.behavior.ajax.AjaxBehaviorRenderer.decode(AjaxBehaviorRenderer.java:47)
at javax.faces.component.behavior.ClientBehaviorBase.decode(ClientBehaviorBase.java:132)
at org.primefaces.renderkit.CoreRenderer.decodeBehaviors(CoreRenderer.java:486)
at org.primefaces.component.datatable.DataTableRenderer.decode(DataTableRenderer.java:64)
at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:831)
at org.primefaces.component.api.UIData.processDecodes(UIData.java:246)
at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:550)
at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183)
at org.primefaces.component.api.UIData.visitTree(UIData.java:692)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at javax.faces.component.UIForm.visitTree(UIForm.java:371)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at javax.faces.component.UINamingContainer.visitTree(UINamingContainer.java:174)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:399)
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:263)
... 26 more
may 17, 2014 10:17:03 PM com.sun.faces.context.AjaxExceptionHandlerImpl handlePartialResponseError
Grave: java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:454)
at java.lang.Integer.parseInt(Integer.java:527)
at org.primefaces.component.datatable.DataTable.queueEvent(DataTable.java:666)
at org.primefaces.behavior.ajax.AjaxBehaviorRenderer.decode(AjaxBehaviorRenderer.java:47)
at javax.faces.component.behavior.ClientBehaviorBase.decode(ClientBehaviorBase.java:132)
at org.primefaces.renderkit.CoreRenderer.decodeBehaviors(CoreRenderer.java:486)
at org.primefaces.component.datatable.DataTableRenderer.decode(DataTableRenderer.java:64)
at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:831)
at org.primefaces.component.api.UIData.processDecodes(UIData.java:246)
at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:550)
at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183)
at org.primefaces.component.api.UIData.visitTree(UIData.java:692)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at javax.faces.component.UIForm.visitTree(UIForm.java:371)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at javax.faces.component.UINamingContainer.visitTree(UINamingContainer.java:174)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740)
at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:399)
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:263)
at org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:60)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:927)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
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:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2430)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2419)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
this is the part of the xhtml page with the dataTable:
<p:dataTable id="nombreAsociados"
var="asociado"
value="#{nuevaInscripcionBacking.asociados}"
editable="true"
emptyMessage="Aún no ha agregado asociados">
<p:ajax event="rowEdit"
update=":#{cc.attrs.id}:formularioNewIns:distDerechosAsoc"
partialSubmit="true"/>
<p:column headerText="Rut">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{asociado.rut}" />
</f:facet>
<f:facet name="input">
<p:inputMask value="#{asociado.rut}" mask="99.999.999-*" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Nombres">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{asociado.nombre}" />
</f:facet>
<f:facet name="input">
<h:inputText value="#{asociado.nombre}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Apellido Paterno">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{asociado.apellidoPaterno}"/>
</f:facet>
<f:facet name="input">
<h:inputText value="#{asociado.apellidoPaterno}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Apellido Materno">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{asociado.apellidoMaterno}"/>
</f:facet>
<f:facet name="input">
<h:inputText value="#{asociado.apellidoMaterno}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Rol Predio">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{asociado.rolPredio}" />
</f:facet>
<f:facet name="input">
<h:inputText value="#{asociado.rolPredio}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column style="width:6%" rendered="#{nuevaInscripcionBacking.ventana==1 || nuevaInscripcionBacking.ventana==3}">
<p:rowEditor />
</p:column>
<p:column style="width: 6%" rendered="#{nuevaInscripcionBacking.ventana==1 || nuevaInscripcionBacking.ventana==3}">
<p:commandLink id="eliminar"
oncomplete="PF('DialogRemoveAsoc').show()"
update=":#{cc.attrs.id}:formEliminarAsociado"
process="#this"
partialSubmit="true"
styleClass="ui-icon ui-icon-trash">
<f:setPropertyActionListener
value="#{asociado}"
target="#{nuevaInscripcionBacking.asociadoAEliminar}" />
</p:commandLink>
</p:column>
</p:dataTable>
The last column is to delete the row. It actually works fine.
In the code above, the list I use to iterate is of objects "Asociados", which is just a bean with it's corresponding getters and setters.
Any help would be appreciated, thanks in advance.
First of all, I'm a newby
I'm trying to implement a simple composite component in JSF 2.
I wish to initialize an attribute of my CC from java code.
this is the using view:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:o3="http://emcube.it/components">
<ui:composition template="/WEB-INF/templates/default.xhtml">
<ui:define name="content">
<h:form>
<div>
<h:outputText value="#{testHome.getMarker()}" />
</div>
<h:panelGroup border="1">
<div>
<o3:basic id="idBasic" label="xxxEtichetta" value="VALORE"/>
<!--
<o3:edit id="idCod" value="#{testHome.instance.codice}" label="Codice"/>
<h:inputText id="idCod" value="#{testHome.instance.codice}" />
<h:outputLabel value="Codice" for="idCod" style="width:100px;"/>
-->
</div>
<div>
<h:inputText id="idDes" value="#{testHome.instance.descrizione}"/>
<h:outputLabel value="Descrizione" for="idDes" style="width:100px;"/>
</div>
</h:panelGroup>
<h:panelGrid columns="2">
<h:commandButton action="#{testHome.persist()}" value="Salva"/>
<h:commandButton action="#{testHome.leave()}" value="Esci"/>
</h:panelGrid>
</h:form>
<div>
<h:messages id="msgid" showSummary="true"
showDetail="true"
errorStyle="color: #d20005"
infoStyle="color: blue"/>
</div>
</ui:define>
</ui:composition>
</html>
this is the composite Component:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<head>
<title>Not present in rendered output</title>
</head>
<body>
<cc:interface componentType="it.opencube.basicCC">
<cc:attribute name="label" required="true" default="Etichetta"/>
<cc:attribute name="value" required="true"/>
</cc:interface>
<cc:implementation>
<h:outputLabel value="#{cc.attrs.label}" for="#{cc.clientId}itext"/>
<h:inputText id="#{cc.clientId}itext" value="{cc.attrs.value}"/>
</cc:implementation>
</body>
</html>
Here is the Component Class:
#FacesComponent("it.opencube.basicCC")
public class BasicCC extends UIInput implements NamingContainer {
private String label;
private String value;
//getters and setters here
#Override
public void encodeBegin(FacesContext context) throws IOException {
System.out.println("Entering encodeBegin");
context.getAttributes().put("value", "NEW STRING VALUE");
super.encodeBegin(context);
}
#Override
public String getFamily() {
return UINamingContainer.COMPONENT_FAMILY;
}
and finally this is what I have in my taglib.xml
<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
version="2.0">
<namespace>http://emcube.it/components</namespace>
<composite-library-name>components</composite-library-name>
<tag>
<tag-name>basic</tag-name>
<component>
<description>Componente di prova</description>
<component-type>it.opencube.basicCC</component-type>
<renderer-type>javax.faces.Composite</renderer-type>
<!-- <handler-class>org.richfaces.view.facelets.html.TogglePanelTagHandler</handler-class> -->
</component>
<attribute>
<description>Valore del componente</description>
<name>value</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description>Etichetta del componente</description>
<name>label</name>
<type>java.lang.String</type>
</attribute>
</tag>
</facelet-taglib>
But when I run I get this error:
19:17:09,781 GRAVE [javax.enterprise.resource.webcontainer.jsf.application] (http-localhost-127.0.0.1-8080-2) Error Rendering View[/testHome.xhtml]: java.io.IOException: PENDING_I18N: Unable to find composite component root for composite component with id idBasic and class it.emcube.opencube.core.jsf2.components.BasicCC
at com.sun.faces.renderkit.html_basic.CompositeRenderer.encodeChildren(CompositeRenderer.java:73) [jsf-impl-2.1.7-jbossorg-2.jar:]
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at it.emcube.opencube.core.jsf2.components.BasicCC.encodeChildren(BasicCC.java:59) [classes:]
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105) [jsf-impl-2.1.7-jbossorg-2.jar:]
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.render.Renderer.encodeChildren(Renderer.java:168) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125) [jsf-impl-2.1.7-jbossorg-2.jar:]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl-2.1.7-jbossorg-2.jar:]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65) [solder-impl-3.1.0.Final.jar:3.1.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74) [solder-impl-3.1.0.Final.jar:3.1.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_38]
I'm surely missing something basic in my example but I'm really not able to find it out by my self.
Thanks to anyone could help
I am using EJB 3.0 + JPA 2.0 + PrimeFaces 3.2 + JSF 2.0. The navigation in my application was great with no problems when I repeated the same code in every page. When I template.xhtml I used as a master page so that the same code applies to all pages, an error message comes:
javax.servlet.ServletException: Trying to extract rowIndex from clientId 'j_idt36:j_idt38:j_id2' For input string: "j_idt38"
This link show you when the error message rises: http://www.youtube.com/watch?v=rR6CqwBREpM
template.xhtml code :
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script>
window.history.forward();
</script>
<ui:insert name="title">
</ui:insert>
<link href="#{facesContext.externalContext.requestContextPath}/resources/css/cssLayout.css" rel="stylesheet" type="text/css"/>
</h:head>
<h:body>
<f:view locale="#{langueApp.localeCode}">
<p:layout fullPage="true">
<p:layoutUnit position="north" size="100" header="#{bundle.header}" resizable="true" closable="false" collapsible="true">
<ui:include src="template/header.xhtml"/>
</p:layoutUnit>
<p:layoutUnit position="west" size="300" resizable="true" collapsible="true" header="#{bundle.me}" minSize="200">
<ui:include src="template/dynamicmenu.xhtml"/>
</p:layoutUnit>
<ui:insert name="content">
</ui:insert>
<p:layoutUnit position="south" size="0" style="text-align: center;" header="#{bundle.footer}" resizable="false" closable="false" collapsible="false" >
<ui:include src="template/footer.xhtml"/>
</p:layoutUnit>
</p:layout>
</f:view>
</h:body>
the stack trace :
Avertissement: PWC4011: Unable to set request character encoding to UTF-8 from context /ProjetIset2, because request parameters have already been read, or ServletRequest.getReader() has already been called
Avertissement: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NumberFormatException: Trying to extract rowIndex from clientId 'j_idt36:j_idt38:j_id2' For input string: "j_idt38"
at javax.faces.component.UIData.invokeOnComponent(UIData.java:1006)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1403)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:669)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1403)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:669)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1403)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:669)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1403)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:669)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1403)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:669)
at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:305)
at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:188)
at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:452)
at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:148)
at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:303)
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.StandardWrapper.service(StandardWrapper.java:1539)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
I think this is a bug in Mojarra implementation. I traced down to the error in code and fired a bug: http://java.net/jira/browse/JAVASERVERFACES-2623