I try to migrate from 3.0 to 3.1 primefaces and gave me error on the first page.
I'm testing the code that works perfectly with the jar-3.0.RC2.jar primefaces and try to change the primefaces-3.1.RC1.jar.
Thank you for your help.
SERVER: JBOSS 6 final.
The code is as follows:
<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:oc="http://java.sun.com/jsf/composite/components">
<h:head>
<title>#{msgs.pt_login}
</title>
<link rel="stylesheet" type="text/css"
href="#{request.contextPath}/css/base.css"/>
</h:head>
<h:body styleClass="login">
<h:form>
<p:selectOneMenu value="#{selectLanguageController.localizacion}" style="position:absolute;right: 0px">
<f:selectItems value="#{selectLanguageController.localizacionesMap}" />
<p:ajax event="change" process="@this" update="centerContainer"
listener="#{selectLanguageController.cambiarLocalizacion}"/>
</p:selectOneMenu>
<oc:themeSwitcher/>
</h:form>
<h:panelGrid id="centerContainer" style="margin-top: 25%;margin-left: auto;margin-right: auto;">
<h:form id="frmMain">
<p:panel style="width:100%;">
<p:focus context="frmMain"/>
<p:messages id="messages"/>
<f:facet name="header">#{msgs.pt_login}</f:facet>
<h:panelGrid id="loginFrm" columns="2" cellpadding="5">
<h:outputText value="#{msgs.lbl_usuario}"/>
<p:inputText id="txt_user" value="${sessionController.alias}"/>
<h:outputText value="#{msgs.lbl_password}"/>
<p:keyboard id="txt_password" value="#{sessionController.contrasena}"
showMode="button" buttonImageOnly="true"
buttonImage="/images/keyboardpencil.png"
password="true"/>
</h:panelGrid>
<p:commandButton action="#{sessionController.login}" value="${msgs.btn_login}" style="margin-left: auto;margin-right: auto;" ajax="false"/>
</p:panel>
</h:form>
</h:panelGrid>
</h:body>
</html>
And jboss throws the error is as follows:
17:06:20,450 INFO [STDOUT]
17:06:20,450 INFO [STDOUT] > > >> >> >>> >>>
17:06:20,450 INFO [STDOUT] **** Procesando una nueva Peticion ****
17:06:20,450 INFO [STDOUT] Antes de la fase--> RESTORE_VIEW 1
17:06:20,468 INFO [STDOUT] Despues de la fase--> RESTORE_VIEW 1--Vista /login.xhtml
17:06:20,469 INFO [STDOUT] Antes de la fase--> RENDER_RESPONSE 6
17:06:20,606 GRAVE [javax.enterprise.resource.webcontainer.jsf.application] Error Rendering View[/login.xhtml]: javax.faces.FacesException: Cannot find component with identifier "centerContainer" in view.
at org.primefaces.util.ComponentUtils.findClientIds(ComponentUtils.java:249) [:]
at org.primefaces.component.behavior.ajax.AjaxBehaviorRenderer.getScript(AjaxBehaviorRenderer.java:72) [:]
at javax.faces.component.behavior.ClientBehaviorBase.getScript(ClientBehaviorBase.java:99) [:2.0.3-]
at org.primefaces.renderkit.CoreRenderer.encodeClientBehaviors(CoreRenderer.java:332) [:]
at org.primefaces.component.selectonemenu.SelectOneMenuRenderer.encodeScript(SelectOneMenuRenderer.java:258) [:]
at org.primefaces.component.selectonemenu.SelectOneMenuRenderer.encodeEnd(SelectOneMenuRenderer.java:63) [:]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:879) [:2.0.3-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1650) [:2.0.3-]
at javax.faces.render.Renderer.encodeChildren(Renderer.java:164) [:2.0.3-]
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:849) [:2.0.3-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1643) [:2.0.3-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1646) [:2.0.3-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1646) [:2.0.3-]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:389) [:2.0.3-]
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:127) [:2.0.3-]
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:117) [:2.0.3-]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97) [:2.0.3-]
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135) [:2.0.3-]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:309) [:2.0.3-]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) [:6.0.0.Final]
at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:706) [:6.0.0.Final]
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:677) [:6.0.0.Final]
at org.apache.jsp.index_jsp._jspService(index_jsp.java:63)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [:6.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) [:6.0.0.Final]
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [:6.0.0.Final]
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) [:6.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
17:06:20,617 INFO [STDOUT] Despues de la fase--> RENDER_RESPONSE 6--Vista /login.xhtml
17:06:20,617 INFO [STDOUT] ******Peticion Procesada!!****
17:06:20,618 INFO [STDOUT] <<< <<< << << <
17:06:20,618 INFO [STDOUT]
17:06:20,618 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/OpenCEO].[Faces Servlet]] El Servlet.service() para servlet Faces Servlet lanzó una excepción: javax.faces.FacesException: Cannot find component with identifier "centerContainer" in view.
at org.primefaces.util.ComponentUtils.findClientIds(ComponentUtils.java:249) [:]
at org.primefaces.component.behavior.ajax.AjaxBehaviorRenderer.getScript(AjaxBehaviorRenderer.java:72) [:]
at javax.faces.component.behavior.ClientBehaviorBase.getScript(ClientBehaviorBase.java:99) [:2.0.3-]
at org.primefaces.renderkit.CoreRenderer.encodeClientBehaviors(CoreRenderer.java:332) [:]
at org.primefaces.component.selectonemenu.SelectOneMenuRenderer.encodeScript(SelectOneMenuRenderer.java:258) [:]
at org.primefaces.component.selectonemenu.SelectOneMenuRenderer.encodeEnd(SelectOneMenuRenderer.java:63) [:]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:879) [:2.0.3-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1650) [:2.0.3-]
at javax.faces.render.Renderer.encodeChildren(Renderer.java:164) [:2.0.3-]
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:849) [:2.0.3-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1643) [:2.0.3-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1646) [:2.0.3-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1646) [:2.0.3-]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:389) [:2.0.3-]
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:127) [:2.0.3-]
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:117) [:2.0.3-]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97) [:2.0.3-]
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135) [:2.0.3-]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:309) [:2.0.3-]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) [:6.0.0.Final]
at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:706) [:6.0.0.Final]
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:677) [:6.0.0.Final]
at org.apache.jsp.index_jsp._jspService(index_jsp.java:63)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [:6.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) [:6.0.0.Final]
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [:6.0.0.Final]
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) [:6.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
17:06:20,622 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/OpenCEO].[jsp]] Servlet.service() para servlet jsp lanzó excepción: javax.faces.FacesException: Cannot find component with identifier "centerContainer" in view.
at org.primefaces.util.ComponentUtils.findClientIds(ComponentUtils.java:249) [:]
at org.primefaces.component.behavior.ajax.AjaxBehaviorRenderer.getScript(AjaxBehaviorRenderer.java:72) [:]
at javax.faces.component.behavior.ClientBehaviorBase.getScript(ClientBehaviorBase.java:99) [:2.0.3-]
at org.primefaces.renderkit.CoreRenderer.encodeClientBehaviors(CoreRenderer.java:332) [:]
at org.primefaces.component.selectonemenu.SelectOneMenuRenderer.encodeScript(SelectOneMenuRenderer.java:258) [:]
at org.primefaces.component.selectonemenu.SelectOneMenuRenderer.encodeEnd(SelectOneMenuRenderer.java:63) [:]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:879) [:2.0.3-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1650) [:2.0.3-]
at javax.faces.render.Renderer.encodeChildren(Renderer.java:164) [:2.0.3-]
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:849) [:2.0.3-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1643) [:2.0.3-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1646) [:2.0.3-]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1646) [:2.0.3-]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:389) [:2.0.3-]
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:127) [:2.0.3-]
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:117) [:2.0.3-]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97) [:2.0.3-]
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135) [:2.0.3-]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:309) [:2.0.3-]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) [:6.0.0.Final]
at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:706) [:6.0.0.Final]
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:677) [:6.0.0.Final]
at org.apache.jsp.index_jsp._jspService(index_jsp.java:63)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [:6.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) [:6.0.0.Final]
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [:6.0.0.Final]
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) [:6.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
The problem that you have is to do with major changes that have been done from 3.0 to 3.1. Earlier in 3.0 any missing component's and id's were being shown as warnings but now they are being shown as exceptions. To get out of this situation you have to give an "id" for each form. For e.g. replace "h:form"
with h:form id="form1"
and when using update="centerContainer" use update=":form1:centerContainer".
Hopefully this will help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With