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)