Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.0.5
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
java.lang.NoSuchMethodError: org.hibernate.tool.hbm2ddl.SchemaExport.setFormat(Z)Lorg/hibernate/tool/hbm2ddl/SchemaExport;
at org.hibernate.tool.ant.Hbm2DDLGeneratorTask.execute(Hbm2DDLGeneratorTask.java:46)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:122)
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.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at org.apache.tools.ant.Main.runBuild(Main.java:673)
at org.apache.tools.ant.Main.startAnt(Main.java:188)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
Name and version of the database you are using:
mysql 4.1
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Hi all,
I'm trying out alpha5 to see if it fixes another issue. Note: I downloaded from cvs today, as the binary download from sourceforge seemingly did not have hibernate-tools.jar .
Code:
<!-- Formally introduce Ant to the hibernate3 toolset -->
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask">
<classpath>
<fileset dir="${proj.lib}/hibernate3"/>
<fileset dir="${proj.lib}/hibernate3-tools"/>
<fileset dir="${proj.lib}/jakarta-commons"/>
<fileset dir="${proj.lib}/dom4j"/>
<fileset dir="${proj.lib}/j2ee"/>
<fileset dir="${proj.lib}/cglib"/>
<path location="${build.classes}"/>
</classpath>
</taskdef>
<target name="ddl"
description="Generate tables from the O/R mapping files" >
<property name="build.sysclasspath" value="ignore"/>
<echo message="build classes: ${build.classes}" />
<echo message=" " />
<echo message=" " />
<echo message="classpath: ${classpath}" />
<echo message=" " />
<echo message=" " />
<mkdir dir="${build.schema}"/>
<hibernatetool destdir="${build.schema}">
<configuration configurationfile="hibernate-cfg.xml">
<fileset dir="${build.classes}">
<include name="**/*.hbm.xml" />
</fileset>
</configuration>
<hbm2ddl export="false" drop="false" outputfilename="hib3-create-tables.sql" />
</hibernatetool>
</target>
My hibernate-cfg.xml :
Code:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="java:/hibernate/HibernateFactory">
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
</session-factory>
</hibernate-configuration>
Any ideas?
iksrazal