Target Unreachable, identifier resolved to null in JSF 2.2

SaXeTz picture SaXeTz · Dec 10, 2013 · Viewed 108.6k times · Source

I have a problem with JSF 2.2 and CDI, my managerbean is not solved and this error appear

"value="#{userBean.user.name}": Target Unreachable, identifier 'userBean' resolved to null"

This is my manager bean.

@ManagedBean
@RequestScoped
public class UserBean implements Serializable {
    private User user;

    public void setUser(user) {
        this.user = user;
    }
    ...
}

My view is:

<h:form id="login-form">
    <h:outputText value="User"/>
    <h:inputText value="#{userBean.user.name}" id="username"/>

    <h:outputText value="Senha"/>
    <h:inputSecret value="#{userBean.user.password}" id="pasword"/>

    <h:commandButton id="button" value="Login" action="#{userBean.login}"/>

    <h:messages />
</h:form>

Answer

akelec picture akelec · Dec 14, 2014

I want to share my experience with this Exception. My JSF 2.2 application worked fine with WildFly 8.0, but one time, when I started server, i got this "Target Unreacheable" exception. Actually, there was no problem with JSF annotations or tags.

Only thing I had to do was cleaning the project. After this operation, my app is working fine again.

I hope this will help someone!