2 Replies Latest reply on Aug 22, 2006 8:37 AM by k_shahab

    Where am I going wrong...?

    barmyyetti

      Hi all, using 4.0.4 GA and trying to get a simple stateless bean to work with no luck.

      Got a feeling its something to do with descriptors.., or rather the lack of.

      Heres the code:

      package kate;
      
      public interface test {
       public String getTest();
      }
      
      
      package kate;
      
      import javax.ejb.Stateless;
      @Stateless
      public class testBean implements test {
      
       public String getTest(){
       return "Bean has worked!";
       }
      }
      
      
      package kate;
      
      import javax.ejb.EJB;
      public class TestEJB {
       @EJB test bean;
      
       public String getTest(){
       String str = null;
       if(bean == null){
       str = "bean = -------------------------------------------------NULL";
       } else {
       str = "<--- (" + bean.getTest() + ") --->";
       }
       return str;
       }
      }


      Should this work? am I missing something?
      Please help, been trying to get my head round EJB3 & 4.0.4 for 2 weeks now and Im still at this stage :-(