Beginner |
|
Joined: Thu Jun 17, 2004 10:08 am Posts: 21 Location: Paris-France
|
Hi,
I try to generate hbm files from the annotated classes using hibernate tools (version 3.2.0.beta11).
The ant script is:
<path id="hbtoolslib"> <fileset dir="${hibernatetools.lib.dir}"> <include name="*.jar" /> </fileset> <path refid="classpath" /> </path> <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="hbtoolslib" /> <target name="generateHbmFiles" depends="compile" description="generate HBM files"> <hibernatetool destdir="${resources.dir}"> <classpath> <path location="${classes.dir}"/> <path refid="classpath"/> </classpath> <jpaconfiguration/> <hbm2hbmxml/> </hibernatetool> </target>
the error that ocurs is:
[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/map.hbm.ftl [hibernatetool] java.io.FileNotFoundException: Template hbm/map.hbm.ftl not found.
Full stack trace of the exception that occurs:
org.hibernate.tool.hbm2x.ExporterException: Error while processing template hbm/ hibernate-mapping.hbm.ftl at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelpe r.java:257) at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplatePro ducer.java:67) at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.ja va:28) at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.ja va:97) at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.j ava:146) at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(Generi cExporter.java:135) at org.hibernate.tool.hbm2x.GenericExporter$2.process(GenericExporter.ja va:41) at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java :126) at org.hibernate.tool.hbm2x.HibernateMappingExporter.doStart(HibernateMa ppingExporter.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.ja va: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.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: freemarker.template.TemplateException: Error reading included file hb m/map.hbm.ftl at freemarker.core.Include.accept(Include.java:153) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
at freemarker.core.Environment.visit(Environment.java:351) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Environment.include(Environment.java:1375) at freemarker.core.Include.accept(Include.java:155) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Environment.process(Environment.java:176) at freemarker.template.Template.process(Template.java:232) at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelpe r.java:251) ... 23 more Caused by: java.io.FileNotFoundException: Template hbm/map.hbm.ftl not found. at freemarker.template.Configuration.getTemplate(Configuration.java:489)
at freemarker.core.Environment.getTemplateForInclusion(Environment.java: 1357) at freemarker.core.Include.accept(Include.java:143) ... 40 more
Well, i looked into the hibernate-tools.jar and there is no map.hbm.ftl file; where can i find this file or a template t ocreate one ?
thanks
Adrian
|
|