3 Replies Latest reply on Sep 1, 2008 12:49 PM by blabno

    Using @In and @Stateful-Stateless

    nimo stephan Master

      I have a EJB-Component and it is declared as follows:



      @Stateless
      @Name("hello")
      public class HelloEJBBean implements HelloEJBLocal {
      
              public HelloEJBBean() {
              }
      
      @PostConstruct
      public void init() {
      ..
      }
      ..
      }



      Now, I have a POJO in my WAR-File, which works well:


      @Name("pojo")
      public class POJO  {
      
       @In (create=true)
       HelloEJBLocal hello;



      So I do not know, for what do I need the @Stateful/Stateless-Annotations, as all SEAM-Components seems to be stateful via @In. I that right? Makes the extra @Stateful/Stateless-Annotations sense by using @In?


      Why does this not work?


      @Name("pojo")
      public class POJO  {
      
       @EJB
       HelloEJBLocal hello;


      ..
      }