1
resposta

Erro ao clicar no botão Gravar

Consigo acessar a pagina http://localhost:8080/jsf-livraria/livro.xhtml , porém ao clicar em gravar aparece o seguinte erro.

HTTP Status 500 – Internal Server Error


Type Exception Report

Message javax.el.PropertyNotFoundException: /livro.xhtml @20,68 action="#{livroBean.gravar}": Target Unreachable, identifier [livroBean] resolved to null

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception
javax.servlet.ServletException: javax.el.PropertyNotFoundException: /livro.xhtml @20,68 action="#{livroBean.gravar}": Target Unreachable, identifier [livroBean] resolved to null
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)


Root Cause
javax.faces.el.EvaluationException: javax.el.PropertyNotFoundException: /livro.xhtml @20,68 action="#{livroBean.gravar}": Target Unreachable, identifier [livroBean] resolved to null
    javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:94)
    com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:101)
    javax.faces.component.UICommand.broadcast(UICommand.java:315)
    javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:791)
    javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1256)
    com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)


Root Cause
javax.el.PropertyNotFoundException: /livro.xhtml @20,68 action="#{livroBean.gravar}": Target Unreachable, identifier [livroBean] resolved to null
    com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:107)
    javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
    com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:101)
    javax.faces.component.UICommand.broadcast(UICommand.java:315)
    javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:791)
    javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1256)
    com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)


Note The full stack trace of the root cause is available in the server logs.


Apache Tomcat/8.5.35

Preciso de ajuda.

1 resposta

Oi Thiago, tudo bem?

Posta aqui seu código fonte para nós darmos uma olhada.

Abraço!