1 Reply Latest reply on Apr 5, 2007 11:02 AM by Bruce

    TestNG, Eclipse and Database Connectivity Error

    Bruce Newbie

      Hi There

      I'm try to write a very basic test and run it from Eclipse, that gets a hook into a postgres database, but am getting the error

      "No Persistence provider for EntityManager named matches".

      Here is my test.

      public class BasicTest {
       private EntityManagerFactory emf;
       public void test() throws Exception {
       EntityManager em =
       // Some code
       public EntityManagerFactory getEntityManagerFactory() {
       return emf;
       public void init() {
       emf = Persistence.createEntityManagerFactory("matches");
       public void destroy() {

      My persistance.xml looks like this.

      <persistence-unit name="matches">
       <property name="hibernate.hbm2ddl.auto" value="update"/>
       <property name="hibernate.show_sql" value="true"/>
       <property name="jboss.entity.manager.factory.jndi.name"

      And my components.xml has this piece of code.

      <core:managed-persistence-context name="entityManager"
       // Some standard Code
       <core:entity-manager-factory persistence-unit-name="matches"
       jndi-name="java:/matchesEntityManagerFactory" />
       <core:ejb installed="@embeddedEjb@"/>
       // More standard code

      Any advice would be appreciated. I've followed most of the tutorials that I could find, but must be doing something wrong.

      Thanks a lot.