[Hibernate 3] javax.persistence.PersistenceException
Bonjour à tous !
Voilà, je me lance dans hibernate ! J'ai lu pas mal de doc, et j'ai plutot été séduit par les annotations plutot que par le mapping xml.
Seul problème, je n'arrive pas à compiler, voici ce qu'il ressort sur la console:
Code:
1 2 3 4 5 6 7 8 9 10 11
| - Hibernate Annotations 3.3.0.GA
- Hibernate 3.2.5
- hibernate.properties not found
- Bytecode provider name : cglib
- using JDK 1.4 java.sql.Timestamp handling
- Hibernate EntityManager 3.3.1.GA
- 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 jpa
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
at test.Test.main(Test.java:17) |
Pourtant j'ai bien mon fichier persistence.xml qui se trouve dans META-INF:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
<persistence 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_1_0.xsd"
version="1.0">
<persistence-unit name="jpa" transaction-type="RESOURCE_LOCAL">
<!-- provider -->
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<!-- Classes persistantes -->
<property name="hibernate.archive.autodetection" value="class, hbm" />
[...]
</properties>
</persistence-unit>
</persistence> |
J'ai aussi tous les jar:
http://www.mysterra.info/hibernate_petit.jpg
Le build path contient bien le dossier META-INF.
Bref, je n'arrive pas à comprendre les exceptions générées... J'ai lu ce thread:
http://www.developpez.net/forums/...
Mon provider est bien déclaré, et j'ai tous les jar :/
Si vous avez une idée pour me débloquer, merci d'avance !