0 Replies Latest reply on Jan 25, 2007 2:06 PM by Arbi Sookazian

    running testNG test suite in J2SE envmt (w/o JNDI)

    Arbi Sookazian Master

      I am getting following exception when exec'ing following code in testNG test case:

      public void init()
      emf = Persistence.createEntityManagerFactory("RSDB");

      javax.persistence.PersistenceException: org.hibernate.HibernateException: Could not find datasource

      I realized that b/c I am not running inside a JavaEE app server (just in Eclipse with J2SE), the JNDI lookup is not available or won't work.

      I was advise to create a new persistence.xml specifically for testing purposes. This persistence.xml example (not using datasource) is not available in Gavy's example at following link:


      Anybody know how to do this? thx.