On Wed, Apr 7, 2010 at 4:39 AM, Hussein Shafie <[email protected]> wrote:

> XMLmind DITA Converter (ditac) is programmed [a] to detect such non-zero
> exit code and [b] then to exit itself with a code greater than 0.
>


> Therefore it should work fine and we currently don't see which bug we
>
could fix here.
>
> The problem is that ditac invokes something like:
>
> cmd.exe /s /c "fo2docx.bat foo.fo bar.docx"
>

?? My ditac_1_2_0/bin/ditac.bat invokes java directly.
When I modify that .bat file to put echo %ERRORLEVEL% immediately after the
java command, I see it print 0. If I deliberately make a typo in my .ditamap
file (for example), then I see a non-zero exit code and everything works as
I expect.

The bug seems to be that, when java gets the error that the file is in use,
it is exiting with a zero error status. Here is the stack trace:
ditac: ERROR: java.io.FileNotFoundException: C:\...\Source\some.docx (The
process cannot access the file because it is being used by another process)
ditac: ERROR:   at java.io.FileOutputStream.open(Native Method)
ditac: ERROR:   at java.io.FileOutputStream.<init>(Unknown Source)
ditac: ERROR:   at java.io.FileOutputStream.<init>(Unknown Source)
ditac: ERROR:   at
com.xmlmind.fo.converter.docx.DocxTranslator.endDocument(DocxTranslator.java:390)

ditac: ERROR:   at
com.xmlmind.fo.converter.Converter.endDocument(Converter.java:517)
ditac: ERROR:   at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocument(Unknown
Source)
ditac: ERROR:   at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocume
nt(Unknown Source)
ditac: ERROR:   at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Sourc
e)
ditac: ERROR:   at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Sourc
e)
ditac: ERROR:   at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
ditac: ERROR:   at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
Source
)
ditac: ERROR:   at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
 Source)
ditac: ERROR:   at javax.xml.parsers.SAXParser.parse(Unknown Source)
ditac: ERROR:   at
com.xmlmind.fo.converter.Converter.convert(Converter.java:383)
ditac: ERROR:   at com.xmlmind.fo.converter.Driver.convert(Driver.java:493)
ditac: ERROR:   at com.xmlmind.fo.converter.Driver.main(Driver.java:601)
------

Again, when I induce an error in the source files I get a non-zero exit
status.

Thanks,
    -Doug
 
--
XMLmind DITA Converter Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/ditac-support

Reply via email to