3 Replies Latest reply on Jul 28, 2010 6:41 AM by rodolfo risicato

    injecting a local EJB into a service POJO

    Hossein Attar Newbie

      I'm migrating from JBoss AS 4.2.x to JBoss AS 5.1. I noticed that my "service pojos" stopped working when I deploy my app in JBoss AS 5.1 (i.e., the start and create methods are not called automatically).


      I changed the @service annotation from  org.jboss.annotation.ejb.Service; to org.jboss.ejb3.annotation.Service and it seems that the service is being recognized now. However, I got into another problem: My Service POJO has a reference to a local EJB. In Jboss 4, I could easily annotate the field with @EJB and the deoendency was recognied and the EJB was injected. However, in JBoss 5.1, the deployed gives me an error message of type



      I tried using the @Depends annotation as follows



      But it didn;t help. I'd appreciate it if anyone can tell me how an EJB could be injected into a JBoss Service POJO.