1 Reply Latest reply on Nov 29, 2005 10:37 AM by oglueck

    Use of @PersistenceContext within an XMBean?

      Hi,

      Is there a way to have:

      public class MyServiceBean
      {
       @PersistenceContext(unitName="em")
       EntityManager em;
      }
      


      where MyServiceBean is an XMBean? It seems like to get JBoss to pick up the jboss-service.xml, and deploy the XMBean, this has to be packaged in a *.sar, but then em is always null, even though the *.par was deployed successfully with the persistence.xml defining the "em" persistence context. I imagine it may be because @PersistenceContext is an EJB3 feature and therefore has to be in a *.ejb3 file? Is there a way to tell the *.sar to be processed by the EJB deployer? Or maybe a way to have the *.ejb3 file pick up the jboss-service.xml?

      Thanks,
      Mike