0

When I run my project, it threw exeption like this:

Request processing failed; nested exception is javax.persistence.PersistenceException: No Persistence provider for EntityManager named "LessonJPAPU"

My persistence.xml is like this:

<persistence-unit name="LessonJPAPU" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>com.javatpoint.beans.Emp</class>
    <properties>
        <property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/users"/>
        <property name="javax.persistence.jdbc.user" value="postgres"/>
        <property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/>
        <property name="javax.persistence.jdbc.password" value=""/>
    </properties>
</persistence-unit>

What's wrong?

Jérémie Bertrand
  • 3,025
  • 3
  • 44
  • 53
Jahongir
  • 13
  • 6

1 Answers1

0

Make sure that your persistence.xml is in src/main/resources/META-INF folder and that folder is not excluded form classpath.