Having trouble inserting elements using XQJ two times with the same prepared expression
Thursday, 27 May 2010 · 7 messages · last reply 2 Jun 2010
SS
Stefano Santoro27 May 2010 23:13 #
Hi Christian,
when I try to reuse the same prepared expression the second time with a different bound document I get the following array out of bound exception:
java.lang.ArrayIndexOutOfBoundsException: 5
at org.basex.query.up.Primitives.add(Primitives.java:52)
at org.basex.query.up.DBPrimitives.add(DBPrimitives.java:40)
at org.basex.query.up.Updates.add(Updates.java:91)
at org.basex.query.up.Insert.atomic(Insert.java:102)
at org.basex.query.up.Insert.atomic(Insert.java:1)
at org.basex.query.expr.Expr.iter(Expr.java:53)
at org.basex.query.QueryContext.iter(QueryContext.java:322)
at org.basex.query.QueryContext.iter(QueryContext.java:290)
at org.basex.api.xqj.BXQDynamicContext.execute(BXQDynamicContext.java:246)
at org.basex.api.xqj.BXQPreparedExpression.executeQuery(BXQPreparedExpression.java:54)
at NPEReproducer.reproduceNPE(NPEReproducer.java:51)
at NPEReproducer.main(NPEReproducer.java:60)I am enclosing a java class file that reproduces this problem against 6.1.3 basex jar files
Ciao
Stefano
SS
Stefano Santoro29 May 2010 01:36 #
Hi Lukas,
Interesting. I have gotten all your maven repository jar files and included them in the class path as follows:
$ echo $GVYCP
C:\opt\jlib\basex-api\xmldb-api-1.0.jar;C:\opt\jlib\basex-api\xqj-api-1.0.jar;C:\opt\jlib\basex-api\basex-api-6.1.3.jar;C:\opt\jlib\basex-api\basex-6.1.3.jar
the same but more clearly listed
$ dvcp GVYCP
0) C:\opt\jlib\basex-api\xmldb-api-1.0.jar
1) C:\opt\jlib\basex-api\xqj-api-1.0.jar
2) C:\opt\jlib\basex-api\basex-api-6.1.3.jar
3) C:\opt\jlib\basex-api\basex-6.1.3.jar
I have run the same java class I have enclosed in the earlier version as follows:
$ java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)
$ java -cp ".;${GVYCP}" NPEReproducer
java.lang.ArrayIndexOutOfBoundsException: 5
at org.basex.query.up.Primitives.add(Primitives.java:52)
at org.basex.query.up.DBPrimitives.add(DBPrimitives.java:40)
at org.basex.query.up.Updates.add(Updates.java:90)
at org.basex.query.up.Insert.atomic(Insert.java:102)
at org.basex.query.up.Insert.atomic(Insert.java:30)
at org.basex.query.expr.Expr.iter(Expr.java:58)
at org.basex.query.QueryContext.iter(QueryContext.java:322)
at org.basex.query.QueryContext.iter(QueryContext.java:290)
at org.basex.api.xqj.BXQDynamicContext.execute(BXQDynamicContext.java:246)
at org.basex.api.xqj.BXQPreparedExpression.executeQuery(BXQPreparedExpression.java:54)
at NPEReproducer.reproduceNPE(NPEReproducer.java:51)
at NPEReproducer.main(NPEReproducer.java:60)I have also checked out your basex trunk and was able to build basex-6.1.3.jar, and even with that jar the same exception was thrown.
I was not able to build the api maven project as it could not resolve the jax-rx dependency.(see attached log)
I was able though to build an api jar from your trunk that contained only the xml:db and XQJ drivers from trunk, and with that too the same exception was thrown.
So I have tried with the jars that I have downloaded from:
http://www.inf.uni-konstanz.de/dbis/basex/maven/org/xmldb/xmldb-api/1.0/xmldb-api-1.0.jar http://www.inf.uni-konstanz.de/dbis/basex/maven/javax/xml/xquery/xqj-api/1.0/xqj-api-1.0.jar http://www.inf.uni-konstanz.de/dbis/basex/maven/org/basex/basex-api/6.1.3/basex-api-6.1.3.jar http://www.inf.uni-konstanz.de/dbis/basex/maven/org/basex/basex/6.1.3/basex-6.1.3.jar
I have also built basex-6.1.3.jar and basex-6.1.3.jar (w/o jaxrx) from your trunk, and yet I was not able to run it as you were able to do.
Is there anything I am missing?
Ciao
Stefano
Quoted text · Lukas Kircher · 21 lines
On Fri, May 28, 2010 at 9:15 AM, Lukas Kircher <lukaskircher1 at googlemail.com> wrote: > Hey Stefano, > > thanks for your report. > >> I am enclosing a java class file that reproduces this problem against >> 6.1.3 basex jar files > > > Unfortunately I wasn't able to reproduce the exception by running your > code - neither with version 6.1.3 nor with our current repository version. > It runs fine on my machine. Do you have a clue where I could've missed > something? > > Or - if you have another case at hand where you encounter the same problem, > just let us know and we'll see what we can do. > > Kind regards, > Lukas >
SS
Stefano Santoro29 May 2010 01:37 #
Hi Lukas,
just to be thorough I tried all the steps I have described in my earlier e-mail on a different workstations running a different OS (linux), and the attempt yielded the same Exception.
Ciao
Stefano
Quoted text · Stefano Santoro · 89 lines
On Fri, May 28, 2010 at 1:14 PM, Stefano Santoro <stefano at santoro.org> wrote: > Hi Lukas, > > Interesting. I have gotten all your maven repository jar files and > included them in the class path as follows: > > $ echo $GVYCP > C:\opt\jlib\basex-api\xmldb-api-1.0.jar;C:\opt\jlib\basex-api\xqj-api-1.0.jar;C:\opt\jlib\basex-api\basex-api-6.1.3.jar;C:\opt\jlib\basex-api\basex-6.1.3.jar > > the same but more clearly listed > > $ dvcp GVYCP > 0) C:\opt\jlib\basex-api\xmldb-api-1.0.jar > 1) C:\opt\jlib\basex-api\xqj-api-1.0.jar > 2) C:\opt\jlib\basex-api\basex-api-6.1.3.jar > 3) C:\opt\jlib\basex-api\basex-6.1.3.jar > > I have run the same java class I have enclosed in the earlier version > as follows: > > $ java -version > java version "1.6.0_17" > Java(TM) SE Runtime Environment (build 1.6.0_17-b04) > Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing) > > $ java -cp ".;${GVYCP}" NPEReproducer > java.lang.ArrayIndexOutOfBoundsException: 5 > at org.basex.query.up.Primitives.add(Primitives.java:52) > at org.basex.query.up.DBPrimitives.add(DBPrimitives.java:40) > at org.basex.query.up.Updates.add(Updates.java:90) > at org.basex.query.up.Insert.atomic(Insert.java:102) > at org.basex.query.up.Insert.atomic(Insert.java:30) > at org.basex.query.expr.Expr.iter(Expr.java:58) > at org.basex.query.QueryContext.iter(QueryContext.java:322) > at org.basex.query.QueryContext.iter(QueryContext.java:290) > at org.basex.api.xqj.BXQDynamicContext.execute(BXQDynamicContext.java:246) > at org.basex.api.xqj.BXQPreparedExpression.executeQuery(BXQPreparedExpression.java:54) > at NPEReproducer.reproduceNPE(NPEReproducer.java:51) > at NPEReproducer.main(NPEReproducer.java:60) > > I have also checked out your basex trunk and was able to build > basex-6.1.3.jar, and even with that jar the same exception was thrown. > > I was not able to build the api maven project as it could not resolve > the jax-rx dependency.(see attached log) > > I was able though to build an api jar from your trunk that contained > only the xml:db and XQJ drivers from trunk, and with that too the same > exception was thrown. > > So I have tried with the jars that I have downloaded from: > > http://www.inf.uni-konstanz.de/dbis/basex/maven/org/xmldb/xmldb-api/1.0/xmldb-api-1.0.jar > http://www.inf.uni-konstanz.de/dbis/basex/maven/javax/xml/xquery/xqj-api/1.0/xqj-api-1.0.jar > http://www.inf.uni-konstanz.de/dbis/basex/maven/org/basex/basex-api/6.1.3/basex-api-6.1.3.jar > http://www.inf.uni-konstanz.de/dbis/basex/maven/org/basex/basex/6.1.3/basex-6.1.3.jar > > I have also built basex-6.1.3.jar and basex-6.1.3.jar (w/o jaxrx) from > your trunk, and yet I was not able to run it as you were able to do. > > Is there anything I am missing? > > Ciao > Stefano > > > > On Fri, May 28, 2010 at 9:15 AM, Lukas Kircher > <lukaskircher1 at googlemail.com> wrote: >> Hey Stefano, >> >> thanks for your report. >> >>> I am enclosing a java class file that reproduces this problem against >>> 6.1.3 basex jar files >> >> >> Unfortunately I wasn't able to reproduce the exception by running your >> code - neither with version 6.1.3 nor with our current repository version. >> It runs fine on my machine. Do you have a clue where I could've missed >> something? >> >> Or - if you have another case at hand where you encounter the same problem, >> just let us know and we'll see what we can do. >> >> Kind regards, >> Lukas >> >
MS
Hi Stefano,
Quoted text · Stefano Santoro · 3 lines
Am 28.05.2010 um 23:36 schrieb Stefano Santoro: > I was not able to build the api maven project as it could not resolve > the jax-rx dependency.(see attached log)
Sorry for this inconvenience. This is due to our colleagues Maven repository @http://xen5.disy.inf.uni-konstanz.de/repo/snapshotRepository having either moved or not being reachable at the time. This will most probably be solved next week.
I attached a tarball that contains the necessary files to unpack into your Maven 2 local repository (usually ~/.m2/repository)
Quoted text · Stefano Santoro · 7 lines
> x jax-rx/ > x jax-rx/jax-rx/ > x jax-rx/jax-rx/1.2/ > x jax-rx/jax-rx/1.2/jax-rx-1.2.jar > x jax-rx/jax-rx/1.2/jax-rx-1.2.jar.sha1 > x jax-rx/jax-rx/1.2/jax-rx-1.2.pom > x jax-rx/jax-rx/1.2/jax-rx-1.2.pom.sha1
This should solve the build issue until xen5 is up and running again and we updated our pom.xml. We'll keep you updated.
Kind regards
Michael
SG
Sebastian Graf29 May 2010 12:53 #
Hello Stefano,
Sorry for the inconvenience, I wasn't aware about the side effect of reinstalling our Maven Repo since it was intentionally thought as an internal tool. However, I just uploaded Jax-RX 1.2.1 to resolve the url to the new path(@basex: maybe you should adapt our dependency to jax-rx).
Furthermore I added an apache redirect matchin the old URL and mapping to the new one. Hopefully that helps.
Sorry again for the trouble.
regards
sebastian
Quoted text · Michael Seiferle · 25 lines
Am 29.05.2010 um 11:14 schrieb Michael Seiferle: > Hi Stefano, > > Am 28.05.2010 um 23:36 schrieb Stefano Santoro: >> I was not able to build the api maven project as it could not resolve >> the jax-rx dependency.(see attached log) > Sorry for this inconvenience. This is due to our colleagues Maven repository @http://xen5.disy.inf.uni-konstanz.de/repo/snapshotRepository > having either moved or not being reachable at the time. This will most probably be solved next week. > > I attached a tarball that contains the necessary files to unpack into your Maven 2 local repository (usually ~/.m2/repository) >> x jax-rx/ >> x jax-rx/jax-rx/ >> x jax-rx/jax-rx/1.2/ >> x jax-rx/jax-rx/1.2/jax-rx-1.2.jar >> x jax-rx/jax-rx/1.2/jax-rx-1.2.jar.sha1 >> x jax-rx/jax-rx/1.2/jax-rx-1.2.pom >> x jax-rx/jax-rx/1.2/jax-rx-1.2.pom.sha1 > > This should solve the build issue until xen5 is up and running again and we updated our pom.xml. > We'll keep you updated. > > Kind regards > Michael > > <jax-rx12.tar.gz>
--------------------------------------------------
Sebastian Graf
Distributed Systems Group
Department of Computer and Information Science
University of Konstanz
Phone: +49 7531 88 4319
Mail: sebastian.graf at uni-konstanz.de
LK
Hey Stefano,
I expect the error to be on my side, your approach looks perfectly fine to me. I'll give it another try and come back to you as soon as I can (presumably tomorrow).
Thanks for efforts, kind regards,
Lukas
Quoted text · Stefano Santoro · 122 lines
On May 28, 2010, at 11:37 PM, Stefano Santoro wrote: > Hi Lukas, > > just to be thorough I tried all the steps I have described in my > earlier e-mail on a different workstations running a different OS > (linux), and the attempt yielded the same Exception. > > Ciao > Stefano > > > On Fri, May 28, 2010 at 1:14 PM, Stefano Santoro > <stefano at santoro.org> wrote: >> Hi Lukas, >> >> Interesting. I have gotten all your maven repository jar files and >> included them in the class path as follows: >> >> $ echo $GVYCP >> C:\opt\jlib\basex-api\xmldb-api-1.0.jar;C:\opt\jlib\basex-api\xqj- >> api-1.0.jar;C:\opt\jlib\basex-api\basex-api-6.1.3.jar;C:\opt\jlib >> \basex-api\basex-6.1.3.jar >> >> the same but more clearly listed >> >> $ dvcp GVYCP >> 0) C:\opt\jlib\basex-api\xmldb-api-1.0.jar >> 1) C:\opt\jlib\basex-api\xqj-api-1.0.jar >> 2) C:\opt\jlib\basex-api\basex-api-6.1.3.jar >> 3) C:\opt\jlib\basex-api\basex-6.1.3.jar >> >> I have run the same java class I have enclosed in the earlier version >> as follows: >> >> $ java -version >> java version "1.6.0_17" >> Java(TM) SE Runtime Environment (build 1.6.0_17-b04) >> Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing) >> >> $ java -cp ".;${GVYCP}" NPEReproducer >> java.lang.ArrayIndexOutOfBoundsException: 5 >> at org.basex.query.up.Primitives.add(Primitives.java:52) >> at org.basex.query.up.DBPrimitives.add(DBPrimitives.java:40) >> at org.basex.query.up.Updates.add(Updates.java:90) >> at org.basex.query.up.Insert.atomic(Insert.java:102) >> at org.basex.query.up.Insert.atomic(Insert.java:30) >> at org.basex.query.expr.Expr.iter(Expr.java:58) >> at org.basex.query.QueryContext.iter(QueryContext.java:322) >> at org.basex.query.QueryContext.iter(QueryContext.java:290) >> at >> org.basex.api.xqj.BXQDynamicContext.execute(BXQDynamicContext.java: >> 246) >> at >> org >> .basex >> .api >> .xqj.BXQPreparedExpression.executeQuery(BXQPreparedExpression.java: >> 54) >> at NPEReproducer.reproduceNPE(NPEReproducer.java:51) >> at NPEReproducer.main(NPEReproducer.java:60) >> >> I have also checked out your basex trunk and was able to build >> basex-6.1.3.jar, and even with that jar the same exception was >> thrown. >> >> I was not able to build the api maven project as it could not resolve >> the jax-rx dependency.(see attached log) >> >> I was able though to build an api jar from your trunk that contained >> only the xml:db and XQJ drivers from trunk, and with that too the >> same >> exception was thrown. >> >> So I have tried with the jars that I have downloaded from: >> >> http://www.inf.uni-konstanz.de/dbis/basex/maven/org/xmldb/xmldb-api/1.0/xmldb-api-1.0.jar >> http://www.inf.uni-konstanz.de/dbis/basex/maven/javax/xml/xquery/xqj-api/1.0/xqj-api-1.0.jar >> http://www.inf.uni-konstanz.de/dbis/basex/maven/org/basex/basex-api/6.1.3/basex-api-6.1.3.jar >> http://www.inf.uni-konstanz.de/dbis/basex/maven/org/basex/basex/6.1.3/basex-6.1.3.jar >> >> I have also built basex-6.1.3.jar and basex-6.1.3.jar (w/o jaxrx) >> from >> your trunk, and yet I was not able to run it as you were able to do. >> >> Is there anything I am missing? >> >> Ciao >> Stefano >> >> >> >> On Fri, May 28, 2010 at 9:15 AM, Lukas Kircher >> <lukaskircher1 at googlemail.com> wrote: >>> Hey Stefano, >>> >>> thanks for your report. >>> >>>> I am enclosing a java class file that reproduces this problem >>>> against >>>> 6.1.3 basex jar files >>> >>> >>> Unfortunately I wasn't able to reproduce the exception by running >>> your >>> code - neither with version 6.1.3 nor with our current repository >>> version. >>> It runs fine on my machine. Do you have a clue where I could've >>> missed >>> something? >>> >>> Or - if you have another case at hand where you encounter the same >>> problem, >>> just let us know and we'll see what we can do. >>> >>> Kind regards, >>> Lukas >>> >> > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
LK
Hey Stefano,
sorry for the delay. I'm glad to tell you that the problem has been solved.
At least I hope so ...
I added the fix to our repository - feel free to check that out. If any further
issues arise, please let us know.
Thanks for your help on improving BaseX!
Kind regards,
Lukas
Written for BaseX 6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery