[jboss-user] [JBoss Seam] - Injection doesnt work

vasana do-not-reply at jboss.com
Mon Dec 10 07:39:26 EST 2007


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?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111591#4111591

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111591



More information about the jboss-user mailing list