Joined: Thu Mar 08, 2007 4:29 pm Posts: 1 Location: Hamburg, Germany
|
Hi,
I am trying to get the GraphViz representation for my Hibernate mappings work with HibernateTools-3.2.0.beta9a on Mac OS X.
Inside the hibernate.cfg.xml I located (dot is accessible from the bash shell just fine):
<property name="dot.executable">/usr/local/bin/dot</property>
This is how I added the schema documentation in my ant task:
<hibernatetool destdir="hibernate-html">
<configuration configurationfile="hibernate.cfg.xml" />
<hbm2doc/>
</hibernatetool>
The result is:
[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.HibernateException: Problem while generating DOT graph for Configuration
[hibernatetool] java.io.IOException: "/usr/local/bin/dot": not found
BUILD FAILED
/Users/niko/perforce/MobileDIS/main/projects/DIS-Core/build.xml:347: org.hibernate.HibernateException: Problem while generating DOT graph for Configuration
at org.hibernate.tool.ant.HibernateToolTask.reportException(HibernateToolTask.java:223)
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.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(DefaultExecutor.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.HibernateException: Problem while generating DOT graph for Configuration
at org.hibernate.tool.hbm2x.DocExporter.generateDot(DocExporter.java:201)
at org.hibernate.tool.hbm2x.DocExporter.doStart(DocExporter.java:151)
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:183)
... 12 more
Caused by: java.io.IOException: "/usr/local/bin/dot": not found
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:52)
at java.lang.ProcessImpl.start(ProcessImpl.java:91)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
at java.lang.Runtime.exec(Runtime.java:591)
at java.lang.Runtime.exec(Runtime.java:429)
at java.lang.Runtime.exec(Runtime.java:326)
at org.hibernate.tool.hbm2x.DocExporter.dotToFile(DocExporter.java:242)
at org.hibernate.tool.hbm2x.DocExporter.generateDot(DocExporter.java:189)
... 16 more
From what I saw in the sources (DocExporter#dotToFile) it seems the dot command is escaped on Mac OS X, but the quotes will not work. To fake a Linux system (where the escape not happens), I specified ANT_OPTS=-Dos.name=Linux which is a bit tricky but seems to work.
Any chances to fix this issue in the next tools release?
Thanks for the nice GraphViz integration anyway,
Niko
|
|