1 Reply Latest reply on Oct 2, 2008 7:28 PM by Alexandre Gattiker

    Injection does not occur with SMPC + EJBs + TestNG

    Alexandre Gattiker Newbie

      When using SMPC in EJBs, I get a NullPointerException in my TestNG tests because injection never occurs:

      public class OntologySourceDAOTest extends SeamTest {
        public void create() throws Exception {
          new ComponentTest() {
            protected void testComponents() throws Exception {
              UserTransaction tx = Transaction.instance();
              OntologySourceDAO dao = (OntologySourceDAO) Component
              OntologySource obj = dao.create(ontologyURI, identifier, name);
      public class OntologySourceDAOSeamJPAImpl ... {
        protected javax.persistence.EntityManager entityManager;

      The EntityManager does not get injected. If I remove the @Stateless annotation, it works. However I would like my DAO to be an EJB and to use a SMPC.

      Using Seam 2.1.0.CR1.