title: Target Unreachable, identifier resolved to null JSF 2.2
body: <p>I looked already those:</p>
  
  <p><a href="https://stackoverflow.com/questions/20504611/target-unreachable-identifier-resolved-to-null-in-jsf-2-2">Target Unreachable, identifier resolved to null in JSF 2.2</a></p>
  
  <p><a href="https://stackoverflow.com/questions/10389919/target-unreachable-identifier-authenticator-resolved-to-null-in-seam">&quot;Target Unreachable, identifier &#39;authenticator&#39; resolved to null&quot; in SEAM</a></p>
  
  <p><a href="https://stackoverflow.com/questions/9809511/java-ee-6-target-unreachable-identifier-hellobean-resolved-to-null">Java EE 6: Target Unreachable, identifier &#39;helloBean&#39; resolved to null</a></p>
  
  <p><a href="https://stackoverflow.com/questions/17771353/jsf-target-unreachable-identifier-bean-name-resolved-to-null">Target Unreachable, identifier &quot;Bean Name&quot; resolved to null</a></p>
  
  <p><a href="https://stackoverflow.com/questions/17771353/jsf-target-unreachable-identifier-bean-name-resolved-to-null">Target Unreachable, identifier &quot;Bean Name&quot; resolved to null</a></p>
  
  <p><a href="https://stackoverflow.com/questions/19268694/jsf-index-xhtml-12-80-value-loginbean-username-target-unreachable-iden">JSF: /index.xhtml @12,80 value=&quot;#{LoginBean.username}&quot;: Target Unreachable, identifier &#39;LoginBean&#39; resolved to null</a></p>
  
  <p><a href="http://www.coderanch.com/t/598907/JSF/java/Target-unreachable-identifier-resolved-null" rel="nofollow noreferrer">http://www.coderanch.com/t/598907/JSF/java/Target-unreachable-identifier-resolved-null</a></p>
  
  <p>but none of them worked for me.</p>
  
  <p>Login.xhtml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"&gt;
  
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  &lt;title&gt;Login Page&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h:form prependId="false"&gt;
  
          &lt;h3&gt;WELLCOME&lt;/h3&gt;
          &lt;br /&gt;
          &lt;h3&gt;Enter&lt;/h3&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;h3&gt;Name&lt;/h3&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;h:inputText value="#{user.name}" id="name" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;h3&gt;password&lt;/h3&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;h:inputSecret value="#{user.password}" id="password" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
  
          &lt;h:commandButton value="Login"&gt;
              &lt;f:ajax execute="name password" render="out" /&gt;
          &lt;/h:commandButton&gt;
          &lt;h3&gt;
              &lt;h:outputText id="out" value="#{user.greeting}" /&gt;
          &lt;/h3&gt;
  
      &lt;/h:form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>User.java:</p>
  
  <pre><code>import java.io.Serializable;
  
  import javax.annotation.ManagedBean;
  import javax.faces.bean.SessionScoped;
  
  @ManagedBean
  @SessionScoped
  public class User implements Serializable {
  
      private String name;
      private String password;
      private String greeting;
  
      public String getGreeting() {
          if (name.length() == 0)
              return "";
          else
              return "Welcome to JSF2 + Ajax, " + name + "!";
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public String getPassword() {
          return password;
      }
  
      public void setPassword(String password) {
          this.password = password;
      }
  
      public void setGreeting(String greeting) {
          this.greeting = greeting;
      }
  
  }
  </code></pre>
  
  <p>I did not config those web.xml, because jsf2.2 does itself as i know.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"&gt;
    &lt;display-name&gt;Ajax&lt;/display-name&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
    &lt;servlet&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
    &lt;context-param&gt;
      &lt;description&gt;State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2&lt;/description&gt;
      &lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt;
      &lt;param-value&gt;client&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;context-param&gt;
      &lt;param-name&gt;javax.servlet.jsp.jstl.fmt.localizationContext&lt;/param-name&gt;
      &lt;param-value&gt;resources.application&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;listener&gt;
      &lt;listener-class&gt;com.sun.faces.config.ConfigureListener&lt;/listener-class&gt;
    &lt;/listener&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Config face:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;faces-config
      xmlns="http://xmlns.jcp.org/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
      version="2.2"&gt;
  
  &lt;/faces-config&gt;
  </code></pre>
  
  <p>Error is when I click button:</p>
  
  <pre><code>        HTTP Status 500 - /Login.xhtml @17,78 value="#{user.name}": Target Unreachable, identifier 'user' resolved to null
  
      --------------------------------------------------------------------------------
  
      type Exception report
  
      message /Login.xhtml @17,78 value="#{user.name}": Target Unreachable, identifier 'user' resolved to null
  
      description The server encountered an internal error that prevented it from fulfilling this request.
  
      exception 
  
  javax.el.PropertyNotFoundException: Target Unreachable, identifier 'user' resolved to null
      at org.apache.el.parser.AstValue.getTarget(AstValue.java:98)
      at org.apache.el.parser.AstValue.getType(AstValue.java:82)
      at org.apache.el.ValueExpressionImpl.getType(ValueExpressionImpl.java:172)
      at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:98)
      at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:95)
      at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1046)
      at javax.faces.component.UIInput.validate(UIInput.java:976)
      at javax.faces.component.UIInput.executeValidate(UIInput.java:1249)
      at javax.faces.component.UIInput.processValidators(UIInput.java:712)
      at javax.faces.component.UIForm.processValidators(UIForm.java:253)
      at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
      at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1195)
      at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>And this warning:</p>
  
  <pre><code>Typee value of the field User.greeting is not used  
  </code></pre>
  
  <p>But there 2 strings to with same get and set but no warnings for them.</p>
  
  <p>I use tomcat 7.0.54.</p>