3 Replies Latest reply on Dec 16, 2007 4:48 PM by pmuir

    Injection doesnt work

    vasana

      Hi,

      I have the following code in the web front end,

      <h:outputLabel for="sarId" align="left" value="SAR No" dir="LTR"/>
       <h:inputText id="sarId" value="#{sar.id}" size="20" align="left"/>
      <s:button value="Add" action="#{taskmgr.addTask}" />
      

      then i have a EntityBean name as follows
      public class OSASar implements Serializable {
      
      
       private String id;
      
       public OSASar(){
      
       }
      
       public OSASar(String id){
       this.id =id;
      
       }
      
       @Id
       @Column(name="Id")
       @Length(max=10)
       public String getId() {
       return id;
       }
      


      and then an SessionBean as
      @Stateless
      @Name("taskmgr")
      
      public class TaskManager implements Task {
      
       @PersistenceContext
       EntityManager em;
      
       @In(value="sar" ,required=true, scope=ScopeType.SESSION)
       private OSASar sar;
      
      
      
       @Logger
       private Log log;
      
      
      
       public TaskManager(){
      
       }
      
      
      
       public void addTask(){
       System.out.println("Name:"+" "+sar.getId());
      
       }
      
      

      when the addTask method is called i am getting
      org.jboss.seam.RequiredException: @In attribute requires non-null value: taskmgr.sar exception.
      Which means value is not getting injectec(?) What could be the possible cause?