Using Hibernate-tools-Beta1
I'm getting an error trying to generate code from my hbm.xml files using hte HibernateToolTask. I'm running a custom exporter via the hbmtemplate ant task. I'm getting this error:
Code:
[hibernatetool] SEVERE: Method get threw exception for reference $templates in template pojo/Pojo.vm at [10,1]
The particular hbm.xml file that it's trying to process has custom data types for some of the columns. These datatypes are non-hibernate pojos that are compiled with a different build process. I know these are causing the problem since when I change them to just "string" type, everything seems to work fine. I've tried specifying the path to these pojos in my build file but it still doesn't seem to make a difference. I've tried variations like this: (I've noted places in the build file below where I tried to specify the class path)
Code:
<taskdef
name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpath="**Tried specifying path to pojo class files here**[location of hibernate-tools.jar, velocity-1.4.jar, velocity-tools-generic-1.4.jar, jtidy-r8-21122004.jar, hibernate3.jar & jdbc drivers]"/>
<hibernatetool destdir="[output dir]">
<classpath> <!-- a classpath is optional, but needed for exporters that require access to domain classes etc. -->
<path location="**tried specifying path to pojo class files here**"/>
</classpath>
<configuration configurationfile="hibernate.cfg.xml" >
<fileset dir="${src.dir}/../test" id="id"> <!-- A configuration can take a configurationfile and/or a fileset of hbm.xml's -->
<include name="**/*TopDown.hbm.xml"/>
</fileset>
</configuration>
<hbmtemplate template="pojo.vm" exporterclass="MyPOJOExporter" filepattern="{package-name}/{class-name}"/>
</hibernatetool>
I can't seem to get it work. Any help is appreciated.