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

Ted Bergeron (JIRA) noreply at atlassian.com
Mon Dec 14 21:07:10 EST 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-1092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=34956#action_34956 ] 

Ted Bergeron commented on HBX-1092:
-----------------------------------

This has been a reported problem for nearly 3 years now:   https://forum.hibernate.org/viewtopic.php?f=6&t=971908

The solution is very simple, Windows is the oddball, not Linux, Mac, Solaris and every other flavor of Unix out there.  Change the escape method logic to IS_WINDOWS and only add the escape characters for that case.





> 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
>   Original Estimate: 2 minutes
>  Remaining Estimate: 2 minutes
>
> 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