title: CDI bean with Application Scope doesn't recognize name of the Session Bean
body: <p>I am getting an error in the AllUsersBean class in the default constructor.
  It doesn't recognize subBean in this line users.add(subBean.clone()); 
  I am using subBi.clone to clone submited info by the user to the UsersList that is called users.
  Thank you for any advice.</p>
  
  <p>This is error:
  <br></p>
  
  <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-
  compile) on project Test: Compilation failure
  [ERROR] ......(here was path to this class) AllUsersBean.java:[25,18] cannot find symbol
  [ERROR] symbol:   variable subBean
  </code></pre>
  
  <p></p>
  
  <p>To solve the problem I trid to add getter and setter for appBean in UserBean class but it doesn't work. </p>
  
  <pre><code>package testpkg;
  
  /*Importing required java libraries */
  import javax.inject.Named; 
  import javax.enterprise.context.ApplicationScoped;
  import java.util.ArrayList;
  import java.util.List;
  
  @Named("appBean")
  @ApplicationScoped
  public class AllUsersBean {
  
     private List&lt;UserBean&gt; users;
  
     public AllUsersBean(){
        users = new ArrayList&lt;UserBean&gt;();
        users.add(subBean.clone());
     }
  
     public List&lt;UserBean&gt; getUsers() {
        return users;
     }
  
     public void setUsers(List&lt;UserBean&gt; users) {
        this.users = users;
     }
  }
  </code></pre>
  
  <p></p>
  
  <p><br> </p>
  
  <pre><code>package testpkg;
  
  /*Importing required java libraries */
  import java.io.Serializable;
  import javax.inject.Named; 
  import javax.inject.Inject; 
  import javax.enterprise.context.SessionScoped;
  
  @Named("subBean")
  @SessionScoped
  public class UserBean implements Serializable{
  
     private String fname;
  
     @Inject
     private AllUsersBean appBean;
  
     public UserBean() {
       this.fname = null;
     }
  
     public String getFname() {
         return fname;
     }
  
     public void setFname(String fname) {
         this.fname = fname;
     }
  
      public AllUsersBean getAppbean() {
         return appBean;
     }
  
     public void setAppbean(AllUsersBean appBean) {
         this.appBean =appBean;
     }
  }
  </code></pre>
  
  <p></p>