[jboss-user] [JBoss Seam] - Newbie question about Injection of Stateless Session Bean

nynymike do-not-reply at jboss.com
Sun Sep 23 10:01:36 EDT 2007


If I have a Stateless Session Bean

  | @Stateless
  | @Name("sb1")
  | public Class SB1 implements ISB1{
  |    public String computePi(){
  |       return "3.14";
  |    }
  | }
  | 

Now let's say I'd like to call the computePi from another Stateless Session Bean. 


  | @Stateless
  | @Name("sb2")
  | public Class SB2 implements ISB2{
  | 
  | @In(create=true,required=false)
  | SB1 sb1;
  | 
  | public String computeCicumference{
  |    String pi = sb1.getPi();
  |    .
  |    .
  |    .
  | }
  | 

Is that the correct way to do it? I'm getting an error about "could not set field value..." 

tia,

- Mike


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

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



More information about the jboss-user mailing list