I try to make GWT application with JPA on Eclipse. But I get this error:
javax.persistence.PersistenceException: No Persistence provider for EntityManager named DogovoraPool
on executing this command:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("DogovoraPool");
I put my persistence.xml all over the place:
- workspace\gwttest\src\META-INF\persistence.xml;
- workspace\gwttest\war\WEB-INF\classes\META-INF\persistence.xml;
- workspace\gwttest\war\WEB-INF\lib\persistence.xml.
But it doesn't help :(
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="DogovoraPool" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>com.val.gwttest.server.entity.Pravform</class>
<properties>
<property name="javax.persistence.jdbc.password" value="xxx" />
<property name="javax.persistence.jdbc.user" value="root" />
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/dogovora" />
<property name="eclipselink.logging.level" value="FINE" />
</properties>
</persistence-unit>
</persistence>
Please, advice me, how to fix it.