1 Reply Latest reply on Mar 5, 2006 4:18 PM by pulsycouac

    presistence.xml with j2se

    tibocu

      Hi,

      I run a j2se application with jax.persistence, but I cannot get the EntityManagerFactory declared in the persistence.xml file.

      My code:
      factory = Persistence.createEntityManagerFactory("em");

      I get: No Persistence provider for EntityManager named em

      The persistence.xml file is located in src/META-INF/persistence.xml

      The application is compiled in the classes directory, with the META-INF/persistence.xml copied.

      The application is not packaed in a jar.

      Shoudl works ?

      Tks

        • 1. Re: presistence.xml with j2se
          pulsycouac

           

          I get: No Persistence provider for EntityManager named em


          Maybe you have not declared the name of your persistence unit in your persistence.xml file:
          <persistence>
           <persistence-unit name="em">
           <jta-data-source>java:/DefaultDS</jta-data-source>
           [...]
           </persistence-unit>
          </persistence>