title: /cars.xhtml @18,74 binding="#{carBean.cars}": Target Unreachable, identifier 'carBean' resolved to null
body: <p>I have a problem with JSF 2.2 and CDI, I don't know if weld is necessary because I am using classfish and it already has CDI, somebody has any idea what's going on?</p>
  
  <p>The error is that:</p>
  
  <pre><code>/cars.xhtml @18,74 binding="#{carBean.cars}": Target Unreachable, identifier 'carBean' resolved to null
  </code></pre>
  
  <p>My managerbean is:</p>
  
  
  
  <pre class="lang-java prettyprint-override"><code>@Named
  public class CarBean implements Serializable {
  
      private List&lt;Car&gt; cars;
  
      @Inject
      private CarRepositoryImpl dao;
  
      private HtmlDataTable dataTable;
  
      public void setDataTable(HtmlDataTable dataTable)
      {
        this.dataTable = dataTable;
      }
  
      public HtmlDataTable getDataTable()
      {
        return dataTable;
      }
  
      public EntityManager entityManager;
  
      public CarController() {
          this.dao = new CarRepositoryImpl(entityManager);
          this.setCarros(this.dao.findAll());
          Car car = new Car();
          car.setDescricao("Teste");
          this.cars.add(car);
      }
  
      public void setCars(List&lt;Car&gt; cars) {
          this.cars = cars;
      }
  
      public List&lt;Car&gt; getCar(){
          return this.cars;
      }
  
  }
  </code></pre>
  
  <p>My JSF page is:
  </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;ui:define name="title"&gt;
      cars sample
  &lt;/ui:define&gt;
  
  &lt;ui:define name="content"&gt;
      &lt;f:view&gt;
          &lt;h:form&gt;
              &lt;h:dataTable value="#{carBean.cars}" var="car"
                           binding="#{carBean.cars}"&gt;
                  &lt;h:column&gt;
                      &lt;f:facet name="header"&gt;
                          &lt;h:outputLabel&gt;description&lt;/h:outputLabel&gt;
                      &lt;/f:facet&gt;
                      &lt;h:outputLabel value="#{car.description}"&gt;&lt;/h:outputLabel&gt;
                  &lt;/h:column&gt;
              &lt;/h:dataTable&gt;
          &lt;/h:form&gt;
      &lt;/f:view&gt;
  &lt;/ui:define&gt;
  </code></pre>