small medium large xlarge

04 Apr 2008, 22:10
Juan E. Murillo (1 post)

After downloading the example files for the book, I followed the instructions to set up the xQuery code with eXist but I cannot get the data to load to the database. I used eXist because there is no downloadable version of marklogic for Mac OS X (the operating system I use).

I get the following error message when loading default.xqy into the browser and then clicking on the “Load” button - please note that I followed all instructions and did not change any default installation path for eXist:

Error found

Could not locate collection: /pragmatic/code/marklogic [at line 20, column 9]

XQuery Stack Trace local:load-dir(xs:string, xs:string, xs:string, xs:string) 59:38 Java Stack Trace: Class Name Method Name File Name Line org.exist.xquery.functions.xmldb.XMLDBAbstractCollectionManipulator eval 134 org.exist.xquery.BasicFunction eval 68 org.exist.xquery.InternalFunctionCall eval 50 org.exist.xquery.AbstractExpression eval 59 org.exist.xquery.PathExpr eval 242 org.exist.xquery.UserDefinedFunction eval 122 org.exist.xquery.FunctionCall evalFunction 223 org.exist.xquery.FunctionCall eval 161 org.exist.xquery.AbstractExpression eval 59 org.exist.xquery.PathExpr eval 242 org.exist.xquery.ForExpr eval 183 org.exist.xquery.BindingExpression eval 158 org.exist.xquery.AbstractExpression eval 59 org.exist.xquery.PathExpr eval 242 org.exist.xquery.EnclosedExpr eval 68 org.exist.xquery.AbstractExpression eval 59 org.exist.xquery.PathExpr eval 242 org.exist.xquery.ElementConstructor eval 237 org.exist.xquery.AbstractExpression eval 59 org.exist.xquery.PathExpr eval 242

13 Apr 2008, 20:11
Pete Aven (1 post)

Hi Juan,

I had the same issue. I was able to create the collections using the exist sandbox (http://localhost:8080/exist/sandbox/sandbox.xql) In the sandbox evaluate the following ( I ran one at a time )

xmldb:create-collection (“/”, “marklogic”) xmldb:create-collection (“/”, “xquery1.0”) xmldb:create-collection (“/”, “common”) xmldb:create-collection (“/”, “exist”)

Once I created the collections, by evaluating the above, I could then run loaddata.xqy successfully and was in business.

14 Apr 2008, 02:42
Ron Hitchens (1 post)

OK, so I made a last minute change to where the source code is loaded and missed an update to the eXist loader script. I’ve updated the sources in Pragmatic’s svn repository, but if you’ve already downloaded the source-ball then you may also encounter this issue.

You can fix it by adding a single line to the file pragmatic/exist/loaddata.xqy in the unpacked .zip file. At about line 20, add a line to the function local:load-dir so that it looks like this (don’t forget the comma):

declare function local:load-dir ($coll as xs:string,
        $fsdir as xs:string,
        $pattern as xs:string, $mime-type as xs:string)
        xmldb:store-files-from-pattern ($coll,
                $fsdir, $pattern, $mime-type, true())

That should do it - just hit the Load button again. Sorry for the hassle.

04 Sep 2011, 02:12
Dan Ion Acceleanu (1 post)

My installation did not work due to a problem with relative paths (eXist v1.4.1 stand alone distribution - Linux box). The problem was that I have started eXist from the ‘bin’ directory ( cd eXist/bin; ./ ). The solution was to start it from the base directory (cd eXist; bin/

Hope this will help others.

  You must be logged in to comment