Subject: Re: [basex-talk] ArrayOutofBound exception on snapshot
From: Christian Grün <[email-masked]>
To: Marco Lettere <[email-masked]>
Cc: BaseX <[email-masked]>
Date: Wed, 21 May 2014 10:20:42 +0200

Hi Marco,

I am not sure, but this doesn't sound like a MIXUPDATES problem to me.
Can you reproduce it without MIXUPDATES=false?

> When passing the XML as postbody and putting the $postbody parameter in the
> db:add the exception occurs.

This worked for me. Did your "accountingrlus" database already contain
some documents? Do you think you can send me a fully reproducible
example? I know it takes time (often more time than fixing the actual
problem ;)..

Thanks,
Christian

PS: If the debugging output is incomplete, it may help to start
basexhttp with the debugging flag (-d, debug=true) or check out the
log files (data/.logs).

>
> declare  %rest:path("test1")
>          %rest:POST("{$postbody}")
>          %rest:consumes("application/xml")
> function page:upd($postbody) {
>          db:add("accountingrlus", document { $postbody } ,
> "coll1/coll2/doc1.xml")
> };
>
>
> The error is not very explanatory since the -d output looks just like this:
>
> MIXUPDATES: true
> Improper use? Potential bug? Your feedback is welcome:
> Contact: [email-masked]
> Version: BaseX 8.0 beta 06146e9
> Java: Oracle Corporation, 1.7.0_51
> OS: Linux, i386
> Stack Trace:
> java.lang.ArrayIndexOutOfBoundsException
> _ REQUEST _________________________________
> [POST /test1]@8945989 org.eclipse.jetty.server.Request@888145
> - DNT: 1
> - Host: localhost:8984
> - Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> - Content-Length: 200
> - Content-Type: application/xml; charset=UTF-8
> - Accept-Language: en-US,en;q=0.5
> - Pragma: no-cache
> - Connection: keep-alive
> - User-Agent: Mozilla/5.0 (X11; Linux i686; rv:28.0) Gecko/20100101
> Firefox/28.0
> - Cache-Control: no-cache
> - Accept-Encoding: gzip, deflate
> _ RESPONSE ________________________________
> HTTP/1.1 500 Unexpected error: Improper use? Potential bug? Your feedback is
> welcome:
> Contact: [email-masked]
> Version: BaseX 8.0 beta 06146e9
> Java: Oracle Corporation, 1.7.0_51
> OS: Linux, i386
> Stack Trace:
> java.lang.ArrayIndexOutOfBoundsException
> Content-Type: text/html;charset=ISO-8859-1
> Cache-Control: must-revalidate,no-cache,no-store
> Content-Length: 1860
>
> Thanks for the support,
> Marco.