xquerydoc icon indicating copy to clipboard operation
xquerydoc copied to clipboard

Error launching xquerydoc 0.1 on Windows

Open fgeorges opened this issue 11 years ago • 6 comments

Hi. I have downloaded the 0.1 package, and installed it in c:/apps/ through the graphical installer. I opened a command prompt, went to c:/.../my-lib/, which contains *.xqy files with xqDoc comments, and launched xquerydoc through the batch file:

C:\...\my-lib> c:/apps/xquerydoc-0.1/xquerydoc.bat

C:\...\my-lib>echo off
xquerydoc 0.1, generates xquery api documentation
Copyright (c) 2011, 2012 Jim Fuller, John Snelson
see https://github.com/xquery/xquerydoc
ECHO is off.
xquery dir: C:\...\my-lib
output dir: C:\...\my-lib\xqdoc
    format: html
ECHO is off.
generating documentation ...
Error: Unable to access jarfile deps\xmlcalabash\calabash.jar

C:\...\my-lib>

Any idea?

fgeorges avatar Jun 28 '13 10:06 fgeorges

In xquerydoc.bat, the line launching Java is:

java -Xmx1024m -jar "deps\xmlcalabash\calabash.jar" -D xquerydoc.xpl "xquery=%XQUERY%" "currentdir=%CURRENTDIR%" "output=%OUTPUT%" "format=%FORMAT%"

If I change deps\xmlcalabash\calabash.jar to c:\apps\xquerydoc-0.1\deps\xmlcalabash\calabash.jar (pasting the whole path to the install dir), then I get the following error:

SEVERE: Underlying exception: net.sf.saxon.s9api.SaxonApiException: I/O error re
ported by XML parser processing file:/C:/.../my-lib/xquerydoc.xpl: C:\...\my-lib\xquerydoc.xpl (The system cannot find the file specified)
com.xmlcalabash.core.XProcException: XProc error err:XD0011
    at com.xmlcalabash.core.XProcException.dynamicError(Unknown Source)
    at com.xmlcalabash.util.XProcURIResolver.parse(Unknown Source)
...

If I then change xquerydoc.xpl to c:/apps/xquerydoc-0.1/xquerydoc.xpl (once again pasting the entire install path), I get the following:

SEVERE: Underlying exception: java.net.MalformedURLException: unknown protocol: c
com.xmlcalabash.core.XProcException: java.net.MalformedURLException: unknown protocol: c
    at com.xmlcalabash.util.URIUtils.getFile(Unknown Source)
    at com.xmlcalabash.library.DirectoryList.run(Unknown Source)
    at com.xmlcalabash.runtime.XAtomicStep.run(Unknown Source)
...

I get the same error whatever I pas a path (like c:/...) or a URI (like file:///c:/...).

So it looks like somewhere in the pipeline, a file path is used as a URI. Which is usually a bomb on Windows whilst is does not generate any error on Unix-like systems.

Any idea how to fix it?

fgeorges avatar Jun 28 '13 10:06 fgeorges

Hi Florent, Where did you get the installer jar from? I tried to fix some of the windows issues a few months ago. The java line with my changes looks like

java -Xmx1024m -jar "%BATPATH%deps\xmlcalabash\calabash.jar" -oresult="%-o%/index.html" "%BATPATH%xquerydoc.xpl" "xquery=%XQUERY%" "currentdir=/%CURRENTDIR%" "output=%OUTPUT%" "format=%-f%"

It is in https://github.com/xquery/xquerydoc/blob/master/xquerydoc-0.1.jar.zip but maybe not in the downloads version. Also the installer in master does not seem to have this fix https://github.com/xquery/xquerydoc/pull/25#issuecomment-14034743

apb2006 avatar Jun 28 '13 12:06 apb2006

Thank you Andy! I downloaded the ZIP file from https://github.com/xquery/xquerydoc/downloads. So it looks like two different 0.1 ZIP files are out there, with different contents... I'd like to try your line, but it references a variable BATPATH, which is not in the .bat I have... Can you copy the entire .bat file, please?

fgeorges avatar Jun 28 '13 14:06 fgeorges

So it looks like two different 0.1 ZIP files are out there, with different contents

Yes. https://github.com/xquery/xquerydoc/blob/master/xquerydoc.bat

apb2006 avatar Jun 28 '13 14:06 apb2006

Thank you! It seems to work better, except there is still an error related to paths:

SEVERE: Pipeline failed: java.lang.IllegalArgumentException: Illegal character in path at index 10: file:///C:\...\mylib\xqdoc/xqdoc_lib-search_conversion.xqy.html

Is it possible that this is because it is not compatible with the ZIP file I used? Where did you downloaded yours?

fgeorges avatar Jun 28 '13 15:06 fgeorges

Is it possible that this is because it is not compatible with the ZIP file I used?

Maybe.

Where did you downloaded yours?

https://github.com/xquery/xquerydoc/blob/master/xquerydoc-0.1.jar.zip Do install, then make change to xquerydoc.bat as described https://github.com/xquery/xquerydoc/pull/25#issuecomment-14034743

With these changes it might run, but I have doubts that the XQuery comment parser is working correctly.

apb2006 avatar Jun 28 '13 16:06 apb2006