2 Replies Latest reply on Sep 23, 2007 10:34 AM by nynymike

    Newbie question about Injection of Stateless Session Bean

    nynymike

      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