I still have this problem with hbm2doc bundled in Hibernate Tools3.2.4beta1 (with Hibernate 3.2.6 and Oracle 10.2).
I am using JPA annotations, how can I know which class raises the problem?
Stack trace
Code:
hbm2doc:
[hibernatetool] Executing Hibernate Tool with a Hibernate Annotation/EJB3 Configuration
[hibernatetool] 1. task: hbm2doc (Generates html schema documentation)
[hibernatetool] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).
[hibernatetool] log4j:WARN Please initialize the log4j system properly.
[hibernatetool] An exception occurred while running exporter #2:hbm2doc (Generates html schema documentation)
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] org.hibernate.tool.hbm2x.ExporterException: Error while processing Unknown context with template doc/tables/table.ftl
[hibernatetool] freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.doc.DocFileManager.getRef(org.hibernate.tool.hbm2x.doc.DocFile,org.hibernate.tool.hbm2x.doc.DocFile) threw an exception when invoked on org.hibernate.tool.hbm2x.doc.DocFileManager@4310d0
[hibernatetool] java.lang.IllegalArgumentException: To cannot be null.
BUILD FAILED
org.hibernate.tool.hbm2x.ExporterException: Error while processing Unknown context with template doc/tables/table.ftl
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:261)
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.DocExporter.processTemplate(DocExporter.java:614)
at org.hibernate.tool.hbm2x.DocExporter.generateTablesDetails(DocExporter.java:415)
at org.hibernate.tool.hbm2x.DocExporter.doStart(DocExporter.java:154)
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:288)
(...)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.doc.DocFileManager.getRef(org.hibernate.tool.hbm2x.doc.DocFile,org.hibernate.tool.hbm2x.doc.DocFile) threw an exception when invoked on org.hibernate.tool.hbm2x.doc.DocFileManager@4310d0
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:136)
(...)
at freemarker.template.Template.process(Template.java:232)
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:255)
... 26 more
Caused by: java.lang.IllegalArgumentException: To cannot be null.
at org.hibernate.tool.hbm2x.doc.DocFileManager.getRef(DocFileManager.java:466)
(...)
at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:616)
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:113)
... 46 more
Ant:
Code:
<target name="hbm2doc">
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="hibernate.class.path" />
<hibernatetool destdir="target/hibernate3/hbm2doc">
<classpath>(...)</classpath>
<annotationconfiguration configurationfile="hibernateConfig.xml"/>
<hbm2doc/>
</hibernatetool>
</target>