Persistence unit not found: 'null'.
Bonjour,
J'utilise toplink + hibernate pour générer les tables à partir de mes classes java
voici mes fichiers utilisés:
persistence.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
<?xml version="1.0" encoding="Cp1252" ?>
<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"
xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name="jpa" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jpa</jta-data-source>
<non-jta-data-source>jpa</non-jta-data-source>
<class>schema.Fonction</class>
<class>schema.Nature</class>
<class>schema.Adresse</class>
<class>schema.Membre</class>
<class>schema.Ecriture</class>
<class>schema.Famille</class>
<class>schema.TypeStructure</class>
<class>schema.TypeFonction</class>
<class>schema.Structure</class>
<class>schema.Operation</class>
<class>schema.Communaute</class>
<class>schema.Personne</class>
<class>schema.Occupation</class>
<class>schema.Activite</class>
<class>schema.Login</class>
<properties>
<property name="eclipselink.target-server" value="OC4J"/>
<property name="eclipselink.target-database" value="MySQL"/>
<property name="eclipselink.jdbc.read-connections.min" value="5"/>
<property name="eclipselink.jdbc.read-connections.max" value="20"/>
<property name="eclipselink.jdbc.write-connections.min" value="5"/>
<property name="eclipselink.jdbc.write-connections.max" value="20"/>
<property name="eclipselink.logging.file" value="persist.log"/>
<property name="eclipselink.ddl-generation" value="create-tables"/>
<property name="eclipselink.application-location" value="../ddl/"/>
<property name="eclipselink.ddl-generation.output-mode" value="database"/>
<property name="eclipselink.create-ddl-jdbc-file-name"
value="createDDL.sql"/>
<property name="eclipselink.drop-ddl-jdbc-file-name" value="dropDDL.sql"/>
<property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="toplink.jdbc.url"
value="jdbc:mysql://localhost:3306/gestcom"/>
<property name="toplink.jdbc.user" value="root"/>
<property name="toplink.jdbc.password" value="islams"/>
</properties>
</persistence-unit>
</persistence> |
à l'execution je recois l'erreur:
Citation:
onment <clinit>
[hibernatetool] INFO: using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] An exception occurred while running exporter #2:hbm2ddl (Generates database schema)
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] Persistence unit not found: 'null'.
BUILD FAILED
C:\Jdeveloper\mywork\GestCom\Schema\ant_hibernate.xml:55: Persistence unit not found: 'null