7 Replies Latest reply on Mar 5, 2008 9:35 PM by jensaug.jens.augustsson.eu

    Injection question regarding @EJB in a JavaBean

    jensaug.jens.augustsson.eu

      Hi,


      Can I inject a non-@Name annotated SLSB into a Seam JavaBean? At component creation time?


      I was hoping that Seam would also fire a @EJB annotation in a JavaBean somewhat magically, but that don't happen.


      My business logic is prepackaged without Seam annotations in a JAR file, which resides in an EAR file - I cannot update those. I've thrown in my new Seam WAR into that EAR, and would like to have a reference to an EJB in my JavaBean.


      I've tried maaany different ways of using @EJB in my Seam JavaBeans, but no injection event is fired (verified by using setter injection).


      I've tried using @In in my Seam JavaBeans, but I cannot (which is perhaps logical) get Seam to find my none-@Name annotated SLSBs. I've played around with the jndiPattern too. Is this supposed to work?


      So currently, to get it to work, I'm doing a InitialContext lookup in my @Create method but that doesn't look nice.


      br,
      Jens