Note: This was originally posted in the 'users' forum, sorry!
Hibernate version: 3.0
Name and version of the database you are using: hsqldb_1_7_3_3
Hallo -- I'm really sorry if this is a dumb question, but I promise I've been looking all over for answers & I'm drawing a blank.
I'm trying to get the 2nd chapter example from Hibernate: A Developer's Notebook to work with H3.0 and the v3 tools -- I've been trying to use the hbm2java functionality, but it won't work. I've opened up the jar file and made changes to the pathnames in the Ant build file, and have been grandually working my way through a number of errors, but am really stuck on this one. The error I get is this:
Code:
Buildfile: C:\Documents and Settings\DougLivesey\workspace\ch02\build.xml
codegen:
BUILD FAILED
C:\Documents and Settings\DougLivesey\workspace\ch02\build.xml:46: Could not create type hbm2java due to java.lang.NoSuchMethodException: org.hibernate.tool.ant.Hbm2JavaGeneratorTask.<init>(org.apache.tools.ant.Project)
Total time: 1 second
My build file currently looks like this:
Code:
<?xml version="1.0"?>
<project name="Harnessing Hibernate: The Developer's Notebook" default="db" basedir=".">
<!-- Set up properties containing important project directories -->
<property name="source.root" value="src" />
<property name="class.root" value="bin" />
<property name="lib.dir" value="lib" />
<property name="data.dir" value="data" />
<!-- Set up the classpath for compilation and execution -->
<path id="project.class.path">
<!-- Include our own classes -->
<pathelement location="${class.root}" />
<!-- Include jars in the project library directory -->
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<target name="db" description="Runs HSQLDB UI against the database file -- use when app is not running">
<java classname="org.hsqldb.util.DatabaseManager" fork="yes">
<classpath refid="project.class.path" />
<arg value="-driver" />
<arg value="org.hsqldb.jdbcDriver" />
<arg value="-url" />
<arg value="jdbc:hsqldb:${data.dir}/music" />
<arg value="-user" />
<arg value="sa" />
</java>
</target>
<!-- Teach Ant how to use Hibernate's code generation tool -->
<taskdef name="hbm2java"
classname="org.hibernate.tool.ant.Hbm2JavaGeneratorTask"
classpathref="project.class.path" />
<!-- Generate the java code for all mapping files in our source tree -->
<target name="codegen"
description="Generate Java source from the O/R mapping files">
<hbm2java output="${source.root}">
<fileset dir="${source.root}">
<include name="**/*.hbm.xml" />
</fileset>
</hbm2java>
</target>
</project>
If there's any info anyone can point me to on getting this stuff to work, or any advice anyone can give, I'd be VERY grateful.
& if this is a dumb/previously documented question, I promise it's down to me being dumb, and not lazy!
Thanks for any & all advice,
doug.