IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Hibernate Java Discussion :

ShemaExport et ant


Sujet :

Hibernate Java

  1. #1
    Membre expérimenté

    Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2007
    Messages
    690
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : Canada

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2007
    Messages : 690
    Points : 1 478
    Points
    1 478
    Par défaut ShemaExport et ant
    Bonjour,
    J'essaye de faire une tache Ant qui me permet d'utiliser l'outil schemaExport pour créer mon schéma de BD à partir de mes classes java.
    Il faut savoir que l'exportation fonctionne sans ant (compilation manuelle).
    Quand j'execute ma tache, j'obtiens l'erreur :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Schema text failed: Could not parse mapping document from file
    Voici ma tache :
    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
    <target name="schemaexport">
    	    <taskdef name="schemaexport"
    	        classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
    	        classpathref="libraries"/>
     
    	    <schemaexport
    	        properties="${targetdir}/hibernate.cfg.xml"
    	        quiet="no"
    	        text="no"
    	        drop="no"
    	        delimiter=";"
    	        output="./schema-export.sql">
    	        <fileset dir="${sourcedir}">
    	            <include name="**/*.hbm.xml"/>
    	        </fileset>
    	    </schemaexport>
    	</target>
    Quelqu'un a-t-il une idée pour régler ça ????

    Merci !

  2. #2
    Membre expérimenté

    Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2007
    Messages
    690
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : Canada

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2007
    Messages : 690
    Points : 1 478
    Points
    1 478
    Par défaut
    Rebondissement dans l'affaire
    Après avoir typé toutes les variables de mes fichiers de mapping, j'ai maintenant l'erreur :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Duplicate Collection Role Mapping MACLASSE
    Quelqu'un aurait il une idée !!!

  3. #3
    Membre expérimenté

    Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2007
    Messages
    690
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : Canada

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2007
    Messages : 690
    Points : 1 478
    Points
    1 478
    Par défaut
    Personne pour m'aider ????
    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
    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
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    Apache Ant version 1.7.0 compiled on December 13 2006
    Buildfile: C:\Documents and Settings\yazid\workspace\SpDimediaWeb\build.xml
    parsing buildfile C:\Documents and Settings\yazid\workspace\SpDimediaWeb\build.xml with URI = file:/C:/Documents%20and%20Settings/yazid/workspace/SpDimediaWeb/build.xml
    Project base dir set to: C:\Documents and Settings\yazid\workspace\SpDimediaWeb
    [antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found.
    Build sequence for target(s) `schemaexport' is [schemaexport]
    Complete build sequence is [schemaexport, copy-resources, clean, compile, insert_samples, ]
    schemaexport:
    [schemaexport] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
    [schemaexport] log4j:WARN Please initialize the log4j system properly.
     
    BUILD FAILED
    C:\Documents and Settings\yazid\workspace\SpDimediaWeb\build.xml:43: Schema text failed: Could not parse mapping document from file C:\Documents and Settings\yazid\workspace\SpDimediaWeb\src\com\dimedia\entities\Auteur.hbm.xml
    	at org.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:149)
    	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
    	at org.apache.tools.ant.Task.perform(Task.java:348)
    	at org.apache.tools.ant.Target.execute(Target.java:357)
    	at org.apache.tools.ant.Target.performTasks(Target.java:385)
    	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
    	at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
    	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    	at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
    	at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
    	at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
    	at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
    Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from file C:\Documents and Settings\yazid\workspace\SpDimediaWeb\src\com\dimedia\entities\Auteur.hbm.xml
    	at org.hibernate.cfg.Configuration.addFile(Configuration.java:291)
    	at org.hibernate.tool.hbm2ddl.SchemaExportTask.getConfiguration(SchemaExportTask.java:202)
    	at org.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:146)
    	... 16 more
    Caused by: org.hibernate.DuplicateMappingException: Duplicate collection role mapping com.dimedia.entities.Auteur.produits
    	at org.hibernate.cfg.Mappings.addCollection(Mappings.java:124)
    	at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2056)
    	at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2031)
    	at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:359)
    	at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:273)
    	at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:144)
    	at org.hibernate.cfg.Configuration.add(Configuration.java:424)
    	at org.hibernate.cfg.Configuration.addFile(Configuration.java:284)
    	... 18 more
    --- Nested Exception ---
    org.hibernate.InvalidMappingException: Could not parse mapping document from file C:\Documents and Settings\yazid\workspace\SpDimediaWeb\src\com\dimedia\entities\Auteur.hbm.xml
    	at org.hibernate.cfg.Configuration.addFile(Configuration.java:291)
    	at org.hibernate.tool.hbm2ddl.SchemaExportTask.getConfiguration(SchemaExportTask.java:202)
    	at org.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:146)
    	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
    	at org.apache.tools.ant.Task.perform(Task.java:348)
    	at org.apache.tools.ant.Target.execute(Target.java:357)
    	at org.apache.tools.ant.Target.performTasks(Target.java:385)
    	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
    	at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
    	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    	at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
    	at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
    	at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
    	at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
    Caused by: org.hibernate.DuplicateMappingException: Duplicate collection role mapping com.dimedia.entities.Auteur.produits
    	at org.hibernate.cfg.Mappings.addCollection(Mappings.java:124)
    	at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2056)
    	at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2031)
    	at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:359)
    	at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:273)
    	at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:144)
    	at org.hibernate.cfg.Configuration.add(Configuration.java:424)
    	at org.hibernate.cfg.Configuration.addFile(Configuration.java:284)
    	... 18 more
     
    Total time: 797 milliseconds

Discussions similaires

  1. [Ant] utiliser le classpath d'Eclipse avec Ant
    Par XavierZERO dans le forum Eclipse Java
    Réponses: 3
    Dernier message: 30/03/2007, 14h00
  2. [Ant] Récupérer une variable d'envionnement
    Par lionel69 dans le forum ANT
    Réponses: 4
    Dernier message: 25/01/2007, 10h22
  3. [Ant] le srcipt ne passe plus sur la 3.0
    Par yolepro dans le forum Eclipse Java
    Réponses: 2
    Dernier message: 20/01/2004, 12h01
  4. [Ant]Jbuilder9
    Par Theoden dans le forum JBuilder
    Réponses: 34
    Dernier message: 16/10/2003, 15h06
  5. [POSTGRES] Pb à l'installation de Ant
    Par mmike dans le forum PostgreSQL
    Réponses: 4
    Dernier message: 28/05/2003, 10h45

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo