Olá Pessoal,
Estou utilizando em meu projeto o primefaces mobile, as páginas “xhtml” estão funcionando correto, mas a execução dos métodos esta ocorrendo erro, conforme abaixo :
Página JSF
<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<f:view 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"
xmlns:pm="http://primefaces.org/mobile"
contentType="text/html"
renderKitId="PRIMEFACES_MOBILE">
<pm:page title="Contacts">
<!-- Main View -->
<pm:view id="idViewLogin">
<h:form id="idFormLogin">
<pm:header title="Login"/>
<p:focus for="idUserName"/>
<pm:content>
<h:outputLabel for="idUserName" value="Email"/>
<p:inputText id="idUserName" required="true" value="#{usuarioFace.login}"/>
<h:outputLabel for="idPassword" value="Senha"/>
<h:inputSecret id="idPassword" required="true" value="#{usuarioFace.senha}" title="Senha" label="Senha"/>
<p:separator/>
<p:commandButton value="Entrar" actionListener="#{usuarioFace.doFinishLoginMobile(usuarioFace.login,usuarioFace.senha)}"/>
</pm:content>
<pm:footer>
<div align="center">
</div>
</pm:footer>
</h:form>
</pm:view>
</pm:page>
</f:view>
@Named
@SessionScoped
public class UsuarioFace extends BaseCDIBean<Usuario> {
public String doFinishLoginMobile(String login, String senha) {
try {
loggedUser = bean.idUsuarioOk(login,senha);
idUsuario = loggedUser.getId();
return "principalMobile.faces";
} catch (Exception e) {
FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_ERROR,"Usuário ou senha inválido.","Usuário ou senha inválido.");
FacesContext.getCurrentInstance().addMessage("Usuário ou senha inválido.", fm);
return null;
}
}
Erro
Advertência: EJB5184:A system exception occurred during an invocation on EJB UsuarioSession, method: public br.com.entidades.seguranca.Usuario br.com.session.seguranca.UsuarioSession.idUsuarioOk(java.lang.String,java.lang.String)
Advertência: javax.ejb.EJBException
at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:5215)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:5113)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4901)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2045)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1994)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:222)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:89)
at $Proxy268.idUsuarioOk(Unknown Source)
at br.com.onsys.session.seguranca.__EJB31_Generated__UsuarioSession__Intf____Bean__.idUsuarioOk(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267)
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263)
at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:110)
at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56)
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)
at br.com.onsys.session.seguranca.UsuarioSession$Proxy$_$$_Weld$Proxy$.idUsuarioOk(UsuarioSession$Proxy$_$$_Weld$Proxy$.java)
at br.com.onsys.faces.seguranca.UsuarioFace.doFinishLoginMobile(UsuarioFace.java:182)
at br.com.onsys.faces.seguranca.UsuarioFace$Proxy$_$$_WeldClientProxy.doFinishLoginMobile(UsuarioFace$Proxy$_$$_WeldClientProxy.java)