I have the same error occuring although I am not using annotation or Maps.
Here is my ant task
Code:
<hibernatetool destdir="generated">
<!--<configuration propertyfile="hibernate.properties"/>-->
<jdbcconfiguration propertyfile="hibernate.properties" revengfile="revenge.xml" />
<hbm2hbmxml/>
My revenge.xml file is as follows
Code:
<hibernate-reverse-engineering>
<schema-selection match-schema="sentineldev"/>
<type-mapping>
<!-- jdbc-type is name fom java.sql.Types -->
<sql-type jdbc-type="VARCHAR" length='20'
hibernate-type="string" />
<sql-type jdbc-type="VARCHAR" length='1'
hibernate-type="char" />
<!-- length, scale and precision can be used to specify the mapping precisly -->
<sql-type jdbc-type="NUMERIC" precision='1'
hibernate-type="boolean" />
<!-- the type-mappings are ordered. This mapping will be consulted last,
thus overriden by the previous one if precision=1 for the column -->
<sql-type jdbc-type="NUMERIC" hibernate-type="long" />
</type-mapping>
</hibernate-reverse-engineering>
Following is the complete log and stack trace
[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernatetool] 1. task: hbm2hbmxml (Generates a set of hbm.xml files)
[hibernatetool] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[hibernatetool] log4j:WARN Please initialize the log4j system properly.
[hibernatetool] An exception occurred while running exporter #2:hbm2hbmxml (Generates a set of hbm.xml files)
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] org.hibernate.tool.hbm2x.ExporterException: Error while processing template hbm/hibernate-mapping.hbm.ftl
[hibernatetool] freemarker.template.TemplateException: Error reading included file hbm/${c2h.getTag(property)}.hbm.ftl
[hibernatetool] java.io.FileNotFoundException: Template hbm/${c2h.getTag(property)}.hbm.ftl not found.
BUILD FAILED
C:\dnb1\sentinel\local\SentinelHBMProject\build.xml:18: org.hibernate.tool.hbm2x.ExporterException: Error while processing template hbm/hibernate-mapping.hbm.ftl
at org.hibernate.tool.ant.HibernateToolTask.reportException(HibernateToolTask.java:226)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:189)
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.helper.ProjectHelper2.parse(ProjectHelper2.java:142)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.parseBuildFile(InternalAntRunner.java:191)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:400)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
Caused by: org.hibernate.tool.hbm2x.ExporterException: Error while processing template hbm/hibernate-mapping.hbm.ftl
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:257)
at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67)
at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28)
at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97)
at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.java:146)
at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(GenericExporter.java:135)
at org.hibernate.tool.hbm2x.GenericExporter$2.process(GenericExporter.java:41)
at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:126)
at org.hibernate.tool.hbm2x.HibernateMappingExporter.doStart(HibernateMappingExporter.java:34)
at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186)
... 7 more
Caused by: freemarker.template.TemplateException: Error reading included file hbm/${c2h.getTag(property)}.hbm.ftl
at freemarker.template.Include.accept(Include.java:163)
at freemarker.template.Environment.visit(Environment.java:180)
at freemarker.template.MixedContent.accept(MixedContent.java:91)
at freemarker.template.Environment.visit(Environment.java:180)
at freemarker.template.ConditionalBlock.accept(ConditionalBlock.java:78)
at freemarker.template.Environment.visit(Environment.java:180)
at freemarker.template.MixedContent.accept(MixedContent.java:91)
at freemarker.template.Environment.visit(Environment.java:180)
at freemarker.template.Environment.include(Environment.java:1018)
at freemarker.template.Environment.include(Environment.java:964)
at freemarker.template.Include.accept(Include.java:153)
at freemarker.template.Environment.visit(Environment.java:180)
at freemarker.template.MixedContent.accept(MixedContent.java:91)
at freemarker.template.Environment.visit(Environment.java:180)
at freemarker.template.Environment.process(Environment.java:166)
at freemarker.template.Template.process(Template.java:238)
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:251)
... 18 more
Caused by: java.io.FileNotFoundException: Template hbm/${c2h.getTag(property)}.hbm.ftl not found.
at freemarker.template.Configuration.getTemplate(Configuration.java:450)
at freemarker.template.Environment.include(Environment.java:963)
at freemarker.template.Include.accept(Include.java:153)
... 34 more
--- Nested Exception ---
org.hibernate.tool.hbm2x.ExporterException: Error while processing template hbm/hibernate-mapping.hbm.ftl
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:257)
at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67)
at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28)
at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97)
at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.java:146)
at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(GenericExporter.java:135)
at org.hibernate.tool.hbm2x.GenericExporter$2.process(GenericExporter.java:41)
at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:126)
at org.hibernate.tool.hbm2x.HibernateMappingExporter.doStart(HibernateMappingExporter.java:34)
at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186)
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.helper.ProjectHelper2.parse(ProjectHelper2.java:142)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.parseBuildFile(InternalAntRunner.java:191)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:400)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
Caused by: freemarker.template.TemplateException: Error reading included file hbm/${c2h.getTag(property)}.hbm.ftl
at freemarker.template.Include.accept(Include.java:163)
at freemarker.template.Environment.visit(Environment.java:180)
at freemarker.template.MixedContent.accept(MixedContent.java:91)
at freemarker.template.Environment.visit(Environment.java:180)
at freemarker.template.ConditionalBlock.accept(ConditionalBlock.java:78)
at freemarker.template.Environment.visit(Environment.java:180)
at freemarker.template.MixedContent.accept(MixedContent.java:91)
at freemarker.template.Environment.visit(Environment.java:180)
at freemarker.template.Environment.include(Environment.java:1018)
at freemarker.template.Environment.include(Environment.java:964)
at freemarker.template.Include.accept(Include.java:153)
at freemarker.template.Environment.visit(Environment.java:180)
at freemarker.template.MixedContent.accept(MixedContent.java:91)
at freemarker.template.Environment.visit(Environment.java:180)
at freemarker.template.Environment.process(Environment.java:166)
at freemarker.template.Template.process(Template.java:238)
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:251)
... 18 more
Caused by: java.io.FileNotFoundException: Template hbm/${c2h.getTag(property)}.hbm.ftl not found.
at freemarker.template.Configuration.getTemplate(Configuration.java:450)
at freemarker.template.Environment.include(Environment.java:963)
at freemarker.template.Include.accept(Include.java:153)
... 34 more
Please help me... Its urgent :(