-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Template hbm/map.hbm.ftl not found when use <hbm2hbmxml/&
PostPosted: Wed Nov 21, 2007 10:12 am 
Beginner
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 21, 2007 12:25 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
look at set.hbm.ftl and list.hbm.ftl for a basis and copy/adjust it so it will work for map...

..and submit it to our jira as a patch if it works ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.