logo       

XUpate exception in september snapshots: msg#00191

text.xml.exist

Subject: XUpate exception in september snapshots

Hi, I am experiencing a problem with the two september snapshots: I
have a query that also performs an XUptade. Its goal is to generate
unique numbers that I use for putting ids to xml nodes.
I have an ids.xml file that contains something like: <ids>100</ids>.
And here is the request:
xquery version "1.0";
declare namespace xmldb="http://exist-db.org/xquery/xmldb";;
let $root := xmldb:collection('xmldb:exist:///db/rep1', 'admin', '')
let $id := document('/db/rep1/ids.xml')/ids
let $mods := xmldb:update(
$root,
<xu:modifications version="1.0" xmlns:xu="http://www.xmldb.org/xupdate";>
<xu:update select="document('/db/rep1/ids.xml')/ids">
{document('/db/rep1/ids.xml')/ids/number()+1}
</xu:update>
</xu:modifications>)
return <result id="{$id}"/>

Executing this request in any of the september snapshots throws the
below exception.
I also would like to know if there is a better way to generate unique
ids, I mean something automatic and thread-safe as sequences in SQL?

Here goes the exception

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.LinkedList.entry(LinkedList.java:368)
at java.util.LinkedList.get(LinkedList.java:313)
at org.exist.xquery.PathExpr.getExpression(PathExpr.java:162)
at org.exist.xquery.Function.getArgument(Function.java:293)
at org.exist.xquery.functions.FunNumber.pprint(FunNumber.java:74)
at org.exist.xquery.PathExpr.pprint(PathExpr.java:181)
at org.exist.xquery.OpNumeric.pprint(OpNumeric.java:185)
at org.exist.xquery.PathExpr.pprint(PathExpr.java:181)
at org.exist.xquery.EnclosedExpr.pprint(EnclosedExpr.java:106)
at org.exist.xquery.PathExpr.pprint(PathExpr.java:181)
at
org.exist.xquery.ElementConstructor.pprint(ElementConstructor.java:183)
at org.exist.xquery.PathExpr.pprint(PathExpr.java:181)
at
org.exist.xquery.ElementConstructor.pprint(ElementConstructor.java:183)
at org.exist.xquery.PathExpr.pprint(PathExpr.java:181)
at org.exist.xquery.Function.pprint(Function.java:336)
at org.exist.xquery.PathExpr.pprint(PathExpr.java:181)
at org.exist.xquery.LetExpr.pprint(LetExpr.java:119)
at org.exist.xquery.LetExpr.pprint(LetExpr.java:129)
at org.exist.xquery.LetExpr.pprint(LetExpr.java:129)
at org.exist.xquery.PathExpr.pprint(PathExpr.java:181)
at org.exist.xquery.XQuery.compile(XQuery.java:94)
at org.exist.xquery.XQuery.compile(XQuery.java:69)
at org.exist.xmlrpc.RpcConnection.doQuery(RpcConnection.java:256)
at org.exist.xmlrpc.RpcConnection.queryP(RpcConnection.java:1237)
at org.exist.xmlrpc.RpcServer.queryP(RpcServer.java:794)
at org.exist.xmlrpc.RpcServer.queryP(RpcServer.java:774)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.exist.xmlrpc.AuthenticatedHandler.execute(AuthenticatedHandler.java:116)
at
org.exist.xmlrpc.AuthenticatedHandler.execute(AuthenticatedHandler.java:63)
at org.apache.xmlrpc.XmlRpcWorker.invokeHandler(Unknown Source)
at org.apache.xmlrpc.XmlRpcWorker.execute(Unknown Source)
at org.apache.xmlrpc.XmlRpcServer.execute(Unknown Source)
at org.apache.xmlrpc.XmlRpcServer.execute(Unknown Source)
at org.exist.xmlrpc.RpcServlet.doPost(RpcServlet.java:39)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:366)
at
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:293)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:581)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1687)
at
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:544)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1637)
at org.mortbay.http.HttpServer.service(HttpServer.java:875)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:806)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:956)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:823)
at
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:202)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:290)
at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:743)
at java.lang.Thread.run(Thread.java:595)


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise