i know that this question have been asked a thousand times but i couldn't find a solution that work for me so i'm asking it again. I'm trying to make a simple project with only one class and hibernate . But i've got this error when i try access to my webpage :
javax.persistence.PersistenceException: No Persistence provider for EntityManager named testhibernate0
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:61)
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)
servlet.Main.start(Main.java:21)
servlet.Servlet.doGet(Servlet.java:14)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Here is my class Personne.java :
package bean;
import java.util.ArrayList;
import javax.persistence.*;
@Entity
@Table( name = "personne")
public class Personne {
@Id
@GeneratedValue
private int id ;
private String nom ;
@ManyToOne
@JoinColumn(name="Maison")
private ArrayList<Maison> listMaison;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public ArrayList<Maison> getListMaison() {
return listMaison;
}
public void setListMaison(ArrayList<Maison> listMaison) {
this.listMaison = listMaison;
}
public void addMaison(Maison maison) {
listMaison.add(maison);
}
}
And here is my file persistence.xml (i've found on google that i should have one for properties and to get rid of that stupid error but it didn't worked)
<?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="testhibernate0" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>Personne</class>
<properties>
[...]
</properties>
</persistence-unit>
</persistence>
And here is a screenshot of my jars : clic here
If someone could help me ...
Thx