Joined: Fri Nov 03, 2006 3:02 pm Posts: 4 Location: Chennai, India
|
Hi All,
I am trying to Generate Dao Code using hibernate tools. I am getting the following exception.
[hibernatetool] org.hibernate.tool.hbm2x.ExporterException: Error while processi
ng template dao/daohomebase.ftl
[hibernatetool] freemarker.core.InvalidReferenceException: Expression clazz.hasN
aturalId is undefined on line 200, column 6 in dao/daohomebase.ftl.
BUILD FAILED
C:\Documents and Settings\Fun\Desktop\Test\Code Generation\build.xml:86:
org.hibernate.tool.hbm2x.ExporterException: Error while processing template dao/
daohomebase.ftl
at org.hibernate.tool.ant.HibernateToolTask.reportException(HibernateToo
lTask.java:211)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.ja
va:174)
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(DefaultExe
cutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: org.hibernate.tool.hbm2x.ExporterException: Error while processing te
mplate dao/daohomebase.ftl
This is my
<target name="GenerateDAO" depends="GenerateDAOBase">
<hibernatetool destdir="${build.dir}/generated">
<configuration configurationfile="hibernate.cfg.xml" />
<hbmtemplate
templateprefix="dao/"
template="dao/daohome.ftl"
filepattern="com/dao/{class-name}DAO.java">
<property key="jdk5" value="false" />
<property key="ejb3" value="false" />
</hbmtemplate>
</hibernatetool>
</target>
_________________ Thanks & Regards,
Arul.
|
|