2 Replies Latest reply on May 20, 2008 9:19 AM by fabricio.lemos

    Hibernate SchemaExport

    fabricio.lemos

      Hello,

      I need help to generate my db tables from my hbm files.

      I right click on my Hibernate Configuration and then choose "Run SchemaExport" but i got the message

      "1 error(s) while performing SchemaExport, see Error Log for details / Reason: <no message>".

      My hibernate.cfg.xml is

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
       "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
      <hibernate-configuration>
       <session-factory>
       <property name="connection.driver_class">
       org.postgresql.Driver
       </property>
       <property name="connection.url">
       jdbc:postgresql://localhost/teste
       </property>
       <property name="connection.username">postgres</property>
       <property name="connection.password">postgres</property>
       <property name="dialect">
       org.hibernate.dialect.PostgreSQLDialect
       </property>
       <property name="show_sql">true</property>
       <property name="hbm2ddl.auto">create</property>
       <mapping resource="person.hbm.xml" />
       </session-factory>
      </hibernate-configuration>


      I am using Jboss Tools 2.0.1GA

      thanks in advance,
      Fabricio Lemos

        • 1. Re: Hibernate SchemaExport
          maxandersen

          what is in the error log?

          • 2. Re: Hibernate SchemaExport
            fabricio.lemos

            I tried to reproduce the error, but now SchemeExport is disable. When I try to expand the configuration, it gives me the error:

            org.hibernate.InvalidMappingException: Could not parse mapping document from file

            In the log file I have:

             at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:103)
             at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:196)
             at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
            Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping com.prototipo.model.Person
             at org.hibernate.cfg.Mappings.addClass(Mappings.java:118)
             at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:145)
             at org.hibernate.cfg.Configuration.add(Configuration.java:669)
             at org.hibernate.cfg.Configuration.addFile(Configuration.java:309)
             ... 9 more
            !SUBENTRY 2 org.hibernate.eclipse.console 4 150 2008-05-20 10:11:40.030
            !MESSAGE org.hibernate.InvalidMappingException: Could not parse mapping document from file C:\workspaces\jbosstools3\teste\src\main\resources\person.hbm.xml
            !STACK 0
            org.hibernate.InvalidMappingException: Could not parse mapping document from file C:\workspaces\jbosstools3\teste\src\main\resources\person.hbm.xml
             at org.hibernate.cfg.Configuration.addFile(Configuration.java:319)
             at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:225)
             at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
             at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:189)
             at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:106)
             at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:38)
             at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:97)
             at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:103)
             at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:196)
             at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
            Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping com.prototipo.model.Person
             at org.hibernate.cfg.Mappings.addClass(Mappings.java:118)
             at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:145)
             at org.hibernate.cfg.Configuration.add(Configuration.java:669)
             at org.hibernate.cfg.Configuration.addFile(Configuration.java:309)
             ... 9 more
            !SUBENTRY 2 org.hibernate.eclipse.console 4 150 2008-05-20 10:11:40.030
            !MESSAGE org.hibernate.DuplicateMappingException: Duplicate class/entity mapping com.prototipo.model.Person
            !STACK 0
            org.hibernate.DuplicateMappingException: Duplicate class/entity mapping com.prototipo.model.Person
             at org.hibernate.cfg.Mappings.addClass(Mappings.java:118)
             at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:145)
             at org.hibernate.cfg.Configuration.add(Configuration.java:669)
             at org.hibernate.cfg.Configuration.addFile(Configuration.java:309)
             at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:225)
             at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
             at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:189)
             at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:106)
             at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:38)
             at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:97)
             at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:103)
             at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:196)
             at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)