0 Replies Latest reply on Apr 27, 2006 3:43 PM by arthur83

    EntityManager JNDI lookup

    arthur83

      Hello everybody,

      I have a problem looking up the EntityManager via JNDI. Here a codesnippet:

      InitialContext ctx = new InitialContext();
      EntityManager em = (EntityManager) ctx.lookup("java:comp/EntityManager/wfms");
      


      and here is my persistence.xml
      <persistence>
       <persistence-unit name="wfms">
       <properties>
       <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
       <property name="hibernate.show_sql" value="false"/>
       </properties>
       </persistence-unit>
      </persistence>
      


      I have tried various lookup-names, but I always get a NameNotFoundException. The deployed file is wfms.ejb3.


      What is wrong, or can anyone suggest a documentation where the naming-convention is explained for that?


      Thanks in advance!

      Regards,
      Arthur