0 Replies Latest reply on Sep 27, 2009 4:36 AM by - -

    Startup seam object cannot get Entity Manager in JEE container

    - - Newbie
      Hi everybody,

      I plan to write a startup seam object in application scope for some business logic in JEE container.

      The seam object works when the server start; say system out something which prove it is being run.

      But I found that seam object cannot get entity manager, which return null value,  in either way of below declaration. (which I plan to connect database for some business logic)

      1. @PersistenceContext(unitName = "XProjectDatabase")
          private EntityManager em;

      2. @In(value="XProjectDatabase")
          EntityManager em;

      For information, the persistence.xml is declared as below

          <persistence-unit name="XProjectDatabase">
               <property name="eclipselink.target-server" value="WebLogic_10"/>
               <property name="eclipselink.target-database" value="SyBase"/>
               <property name="eclipselink.logging.level" value="INFO"/>
               <property name="eclipselink.logging.logger" value="DefaultLogger"/>

      Can someone helps me?