[hibernate-issues] [Hibernate-JIRA] Created: (HBX-1092) hbm2doc with graphing fails on MacOSX

Avram Cherry (JIRA) noreply at atlassian.com
Fri Oct 24 01:52:05 EDT 2008


hbm2doc with graphing fails on MacOSX
-------------------------------------

                 Key: HBX-1092
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1092
             Project: Hibernate Tools
          Issue Type: Bug
          Components: hbm2doc
    Affects Versions: 3.2.0.GA, 3.2.2
            Reporter: Avram Cherry


In the method org.hibernate.tool.hbm2x.DocExporter.dotToFile, the portions of the command passed to Runtime.exec() are being passed to an escape(String) method that optionally adds quotes to the executable file path and the path to the input file, but only if the OS is not linux.  MacOSX is not linux, but adding quotes causes exec() to fail.

The solution is to change the following statement:

String exeCmd = escape(dotExeFileName) + " -T" + getFormatForFile(outFileName) + " " + escape(dotFileName) + " -o " + escape(outFileName);

to:

String[] exeCmd = new String[] {dotExeFileName, " -T", getFormatForFile(outFileName), dotFileName, " -o ", outFileName};

If you pass the command and arguments as separate strings within an array to Runtime.exec() you do not need to quote filenames, regardless of platform.

A (potentially very harmful) workaround is to pass -Dos.name=Linux to the VM.

Please note that I've checked both the 3.2 branch and trunk and both contain the same problem.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list