-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: hbm2ddl problem
PostPosted: Fri Apr 21, 2006 2:12 pm 
Beginner
Beginner

Joined: Mon Sep 08, 2003 10:56 am
Posts: 35
ant build fails with no such method error. I'm not completely sure what could be causing this so that I could continue to debug the problem. This is my first run at attempting to generate a ddl from my hbm files, so I thought I'd ask for some help and see if any of you guys could point me in the right direction of where to go next.

build file task def:

Code:
<target name="schemaexport">
      <taskdef
           name="hibernatetool"
           classname="org.hibernate.tool.ant.HibernateToolTask"
           classpathref="hibernate.classpath"/>
      
      <hibernatetool
        destdir="etc/ant"
        templatepath="etc/ant"
      >
         <configuration configurationfile="${basedir}/src/hibernate-console.cfg.xml" >
            <fileset dir="src" includes="**/Address.hbm.xml" />
         </configuration>
      <hbm2ddl drop="true"
       create="true"
       update="false"
       outputfilename="filename.ddl"
       delimiter=";"
       format="true"
      />
      </hibernatetool>
   </target>


Here is the output I get:


[hibernatetool] DEBUG 13:08:39 [main] - Mapped property: id -> aid
[hibernatetool] DEBUG 13:08:39 [main] - Mapped property: addressOne -> address_one
[hibernatetool] DEBUG 13:08:39 [main] - Mapped property: addressTwo -> address_two
[hibernatetool] DEBUG 13:08:39 [main] - Mapped property: city -> city
[hibernatetool] DEBUG 13:08:39 [main] - Mapped property: county -> county
[hibernatetool] DEBUG 13:08:39 [main] - Mapped property: state -> state
[hibernatetool] DEBUG 13:08:39 [main] - Mapped property: country -> country
[hibernatetool] DEBUG 13:08:39 [main] - Mapped property: postalCode -> postal_code
[hibernatetool] DEBUG 13:08:40 [main] - Mapped property: lat -> lat
[hibernatetool] DEBUG 13:08:40 [main] - Mapped property: lng -> lng
[hibernatetool] INFO 13:08:40 [main] - processing extends queue
[hibernatetool] INFO 13:08:40 [main] - processing collection mappings
[hibernatetool] INFO 13:08:40 [main] - processing association property references
[hibernatetool] INFO 13:08:40 [main] - processing foreign key constraints
[hibernatetool] INFO 13:08:40 [main] - Using dialect: org.hibernate.dialect.MySQLDialect
[hibernatetool] INFO 13:08:40 [main] - processing extends queue
[hibernatetool] INFO 13:08:40 [main] - processing collection mappings
[hibernatetool] INFO 13:08:40 [main] - processing association property references
[hibernatetool] INFO 13:08:40 [main] - processing foreign key constraints
[hibernatetool] INFO 13:08:40 [main] - processing extends queue
[hibernatetool] INFO 13:08:40 [main] - processing collection mappings
[hibernatetool] INFO 13:08:40 [main] - processing association property references
[hibernatetool] INFO 13:08:40 [main] - processing foreign key constraints

BUILD FAILED
java.lang.NoSuchMethodError: org.hibernate.tool.hbm2ddl.SchemaExport.setHaltOnError(Z)Lorg/hibernate/tool/hbm2ddl/SchemaExport;


And if I turn on Ant debugging :

[hibernatetool] INFO 13:09:48 [main] - processing extends queue
[hibernatetool] INFO 13:09:48 [main] - processing collection mappings
[hibernatetool] INFO 13:09:48 [main] - processing association property references
[hibernatetool] INFO 13:09:48 [main] - processing foreign key constraints
Finding class org.apache.commons.collections.SequencedHashMap$2
Loaded from J:\java\hibernate-3.0\lib\commons-collections-2.1.1.jar org/apache/commons/collections/SequencedHashMap$2.class
Class java.util.AbstractCollection loaded from parent loader (parentFirst)
Class org.apache.commons.collections.SequencedHashMap$2 loaded from ant loader (parentFirst)
Finding class org.apache.commons.collections.SequencedHashMap$OrderedIterator
Loaded from J:\java\hibernate-3.0\lib\commons-collections-2.1.1.jar org/apache/commons/collections/SequencedHashMap$OrderedIterator.class
Class org.apache.commons.collections.SequencedHashMap$OrderedIterator loaded from ant loader (parentFirst)
Class java.util.ConcurrentModificationException loaded from parent loader (parentFirst)

BUILD FAILED
java.lang.NoSuchMethodError: org.hibernate.tool.hbm2ddl.SchemaExport.setHaltOnError(Z)Lorg/hibernate/tool/hbm2ddl/SchemaExport;
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1225)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
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: java.lang.NoSuchMethodError: org.hibernate.tool.hbm2ddl.SchemaExport.setHaltOnError(Z)Lorg/hibernate/tool/hbm2ddl/SchemaExport;
at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:50)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:143)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
... 6 more
--- Nested Exception ---
java.lang.NoSuchMethodError: org.hibernate.tool.hbm2ddl.SchemaExport.setHaltOnError(Z)Lorg/hibernate/tool/hbm2ddl/SchemaExport;
at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:50)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:143)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 21, 2006 2:54 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
use the hibernate that comes with the tools - then you are sure they match.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 21, 2006 3:43 pm 
Beginner
Beginner

Joined: Mon Sep 08, 2003 10:56 am
Posts: 35
Thanks for the response, that indeed fixed it. +1 credit for you sir!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.