bom quando iniciei o curso de CDI fiz o tutorial de preparação do ambiente o seguinte erro na pagina de login:
root cause
org.primefaces.expression.ComponentNotFoundException: Cannot find component for expression "@form" referenced from "j_idt12". org.primefaces.expression.SearchExpressionFacade.cannotFindComponent(SearchExpressionFacade.java:673) org.primefaces.expression.SearchExpressionFacade.resolveClientIds(SearchExpressionFacade.java:242) org.primefaces.util.AjaxRequestBuilder.addExpressions(AjaxRequestBuilder.java:92) org.primefaces.util.AjaxRequestBuilder.process(AjaxRequestBuilder.java:79) org.primefaces.renderkit.CoreRenderer.buildAjaxRequest(CoreRenderer.java:362) org.primefaces.component.commandbutton.CommandButtonRenderer.buildRequest(CommandButtonRenderer.java:123) org.primefaces.component.commandbutton.CommandButtonRenderer.encodeMarkup(CommandButtonRenderer.java:65) org.primefaces.component.commandbutton.CommandButtonRenderer.encodeEnd(CommandButtonRenderer.java:54) javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:89) org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:72) org.primefaces.component.fieldset.FieldsetRenderer.encodeContent(FieldsetRenderer.java:94) org.primefaces.component.fieldset.FieldsetRenderer.encodeMarkup(FieldsetRenderer.java:76) org.primefaces.component.fieldset.FieldsetRenderer.encodeEnd(FieldsetRenderer.java:47) javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:437) com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:124) com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
o código de login é este:
<?xml version="1.0" encoding="UTF-8" ?>
<!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://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<ui:composition template="_template.xhtml">
<ui:define name="titulo">
<p:outputPanel>Login</p:outputPanel>
</ui:define>
<ui:define name="conteudo">
<p:messages globalOnly="true"/>
<h:form id="login">
<p:fieldset legend="Login">
<h:panelGrid columns="3">
<p:outputLabel value="Email:" for="email" />
<p:inputText id="email" value="#{loginBean.usuario.email}"
required="true">
<f:passThroughAttribute name="type" value="email" />
</p:inputText>
<p:message for="email" id="messageEmail" />
<p:outputLabel value="Senha:" for="senha" />
<p:password id="senha" value="#{loginBean.usuario.senha}" required="true" feedback="true"/>
<p:message for="senha" id="messageSenha" />
<p:commandButton value="Efetuar Login" action="#{loginBean.efetuaLogin}" update="@form" process="@form"/>
</h:panelGrid>
</p:fieldset>
</h:form>
</ui:define>
</ui:composition>
</html>