Stacktrace says that you're using Tomcat as indicated by org.apache.tomcat/coyote/catalina.*
lines. However, Tomcat does as being a barebones JSP/Servlet container not natively support CDI, it has to be installed separately (like as you did for JSF).
Stacktrace also says that bean isn't managed by @Named
but by @ManagedBean
as indicated by complete absense of CDI proxy class signature in the root cause. If @Named
was really used, you'd have seen an extra line as follows when Weld is used as CDI implementation:
Caused by: java.lang.NullPointerException
at ma.trk.sgpa.controller.LoginAction.logIn(LoginAction.java:35)
--> at ma.trk.sgpa.controller.LoginAction$Proxy$_$$_WeldClientProxy.logIn(LoginAction$Proxy$_$$_WeldClientProxy.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
Also, your comment
still not working. if i remove @ManagedBean my page Xhtml don't know my fields
confirms that CDI isn't properly installed at all. It's also surprising that you didn't explicitly mention anywhere how exactly you installed it because Tomcat+CDI is a special case, which confirms that you actually had no idea what you were doing. Perhaps you just faced a compilation error on @Named
and @Inject
and you just blindly downloaded/moved/copied random JAR files in a careless attempt to solve those compilation errors without actually reading the documentation of CDI implementation as to configuring Tomcat.
Head to the following answer to learn how to get CDI to work in Tomcat: How to install and use CDI on Tomcat?.