Bonjour,
J'ai créé, sous Eclipse, un projet dans lequel je souhaite tester la persistence.
J'ai donc créé un dossier META-INF dans src puis je l'ai ajouté au buildpath.
J'ai ensuite placé à l'intérieur un fichier persistence.xml. Lorsqie je lance le projet, j'obtiens:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 
1 août 2010 18:09:14 org.hibernate.cfg.annotations.Version <clinit>
INFO: Hibernate Annotations 3.4.0.GA
1 août 2010 18:09:14 org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.3.2.GA
1 août 2010 18:09:14 org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
1 août 2010 18:09:14 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : javassist
1 août 2010 18:09:14 org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
1 août 2010 18:09:14 org.hibernate.annotations.common.Version <clinit>
INFO: Hibernate Commons Annotations 3.1.0.GA
1 août 2010 18:09:14 org.hibernate.ejb.Version <clinit>
INFO: Hibernate EntityManager 3.4.0.GA
1 août 2010 18:09:14 org.hibernate.ejb.Ejb3Configuration configure
INFO: Could not find any META-INF/persistence.xml file in the classpath
Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named testmanagerdb
	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:56)
	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
	at fr.hibenatetest.test.App.main(App.java:39)
Le message d'erreur me semble explicite, mais je ne comprends pas pourquoi cela ne marche pas. Je ne vois pas ce que je n'ai pas fait ou mal fait.