title: Target Unreachable, identifier resolved to null
body: <p>I have a problem with a simple web application in JSF 2.2, my managed bean is not solved and I got this error:</p>
  
  <pre><code> /greeting.xhtml @21,66 date="#{dukesBDay.yourBD}": Target Unreachable, identifier 'dukesBDay' resolved to null
  </code></pre>
  
  <p>This is my managed bean:</p>
  
  <pre><code>import javax.ejb.EJB;
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.SessionScoped;
  
  @ManagedBean
  @SessionScoped
  public class DukesBDay {
  
  
  @EJB
  private DukesBirthDayBean dukesBirthdayBean;
  </code></pre>
  
  <p>This is my greeting.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:fc="http://java.sun.com/jsf/composite/components"&gt;
  
  &lt;h:head&gt;
      &lt;title&gt;First Cup Greeting Page&lt;/title&gt;
  &lt;/h:head&gt;
  
  &lt;h:form&gt;
  &lt;h2&gt;
      &lt;h:outputText value="#{bundle.Welcome}"/&gt;
  &lt;/h2&gt;
  &lt;h:outputText value="#{bundle.DukeIs} "/&gt;
  &lt;h:outputText value="#{dukesBDay.age} #{bundle.YearsOldToday}"/&gt;
  &lt;p/&gt;
  &lt;h:outputText value="#{bundle.Instructions}"/&gt;
  &lt;p/&gt;
  &lt;h:outputText value="#{bundle.YourBD} "/&gt;
  &lt;fc:inputDate id="userBirthday" date="#{dukesBDay.yourBD}" /&gt;
  &lt;h:outputText value=" #{bundle.Pattern}"/&gt;
  &lt;p/&gt;
  &lt;h:commandButton value="#{bundle.Submit}" 
                   action="#{dukesBDay.processBirthday}"/&gt;
  &lt;p/&gt;
  &lt;h:message for="userBirthday" style="color:red"/&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p></p>
  
  <p>and this is my web.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="3.1" 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-app_3_1.xsd"&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt;
      &lt;param-value&gt;Development&lt;/param-value&gt;
  &lt;/context-param&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;*.xhtml&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;session-config&gt;
      &lt;session-timeout&gt;
          30
      &lt;/session-timeout&gt;
  &lt;/session-config&gt;
  &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;greeting.xhtml&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I tried adding the name property to @ManagedBean:</p>
  
  <pre><code>package firstcup.web;
  
  import javax.ejb.EJB;
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.SessionScoped;
  @ManagedBean(name="dukesBDay")
  @SessionScoped
  public class DukesBDay {
  </code></pre>
  
  <p>but it doesn't work, still have the same error.</p>
  
  <p>I tried mapping the managed bean in my faces-config:</p>
  
  <pre><code> &lt;managed-bean&gt;
      &lt;managed-bean-name&gt;dukesBDay&lt;/managed-bean-name&gt;
      &lt;managed-bean-class&gt;firstcup.web.DukesBDay&lt;/managed-bean-class&gt;
      &lt;managed-bean-scope&gt;session&lt;/managed-bean-scope&gt;
   &lt;/managed-bean&gt;
  </code></pre>
  
  <p>but I get this error:</p>
  
  <blockquote>
    <p>Unable to create managed bean dukesBDay. The following problems were found: - Bean or property class firstcup.web.DukesBDay for managed bean dukesBDay cannot be found</p>
  </blockquote>
  
  <p>Why my DukesBDay is not solved? What's wrong?</p>
  
  <p>Thanks</p>