3 Replies Latest reply on Sep 8, 2008 7:00 AM by Sandor Arpa

    JNDI in ejb3

    calvin design Newbie

      Dear all,

      How to do a jndi to lookup a datasource in ejb3 ?
      I want to lookup the datasource, grap the connection, and do something rather than using the EntityManager.
      I try
      lookup("java:/mysqlDS");
      lookup("java:comp/env/mysqlDS");

      it always gave me
      javax.naming.NameNotFoundException: "something" not bound

      I have a persistence.xml file in the ejb jar file, mysql-ds.xml file in the \server\default\deploy.

      What i can do to make this thing work ? thanks.