ArrayOutofBound exception on snapshot
Tuesday, 20 May 2014 · 8 messages · last reply 25 May 2014
ML
Marco Lettere20 May 2014 15:18 #
Hello all,
we are investigating on the latest snapshot in order to check how our code cleans up itself when reducing the overhead of the "updating" code by using MIXED UPDATES.
We started experiencing the Index out of bound Exception on a particular insert of a complex XML document. I worked heavily on reducing the document to the smallest example that causes the exception getting to this:
<a b="1" c="2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<b>
<item x="1" w="2"/>
</b>
<n value="1" xsi:type="xs:string"/>
<n value="2" xsi:type="xs:string"/>
</a>Any change that reduces the XML causes the
db:add to work.
When inserting directly with db:add it works.
When putting the same db:add in a restxq it still works.
When passing the XML as postbody and putting the $postbody parameter in the db:add the exception occurs.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: basex-talk at mailman.uni-konstanz.de
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: basex-talk at mailman.uni-konstanz.de
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.CG
Christian Grün21 May 2014 10:20 #
Hi Marco,
I am not sure, but this doesn't sound like a
MIXUPDATES problem to me. Can you reproduce it without MIXUPDATES=false?Quoted text · Marco Lettere · 2 lines
> 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).
Quoted text · Marco Lettere · 49 lines
> > 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: basex-talk at mailman.uni-konstanz.de > 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: basex-talk at mailman.uni-konstanz.de > 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.
SG
Seenivasan Gunabalan21 May 2014 18:01 #
Hi Christian,
yes, we tested by setting
MIXUPDATES = false and the error remains the same.
to reproduce it,
1) deploy a fresh basex instance from latest snapshot
(BaseX80-20140519.172557.zip
<http://files.basex.org/releases/latest/BaseX80-20140519.172557.zip>)
2) create an Empty database i.e. "sample"
3) Add the below function to the restxq.xqm declare %rest:path("test1")
%rest:POST("{$postbody}")
%rest:consumes("application/xml")
updating function page:upd($postbody) {
db:add("sample", document { $postbody } , "sample/dir1/doc1.xml")
};4) now you can test the xml to the restxq url
url: http://localhost:8984/test1
content-type : application/xml
<a b="1" c="2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<b>
<item x="1" w="2"/>
</b>
<n value="1" xsi:type="xs:string"/>
<n value="2" xsi:type="xs:string"/>
</a>or here is my complete basex instance which has only the above mentioned modifications : https://www.dropbox.com/s/yai9dx0smdj2ph9/test_basex.tar.gz
To be sure, i used the out-of-package configuration i.e. didn't modified any settings
Thanks,
Seenivasan
P.S : Platform: Linux
OpenJDK 1.7.0_51
--
*Seenivasan Gunabalan*
Dedalus S.p.A
Via G. March 14/C, 57121 Livorno (Italy)
/email/: seenivasan.gunabalan at dedalus.eu
CG
Christian Grün22 May 2014 09:47 #
Thanks! Reproduced. Having a look.
Quoted text · Seenivasan Gunabalan · 58 lines
On Wed, May 21, 2014 at 6:01 PM, Seenivasan Gunabalan < seenivasan.gunabalan at dedalus.eu> wrote: > Hi Christian, > yes, we tested by setting MIXUPDATES = false and the > error remains the same. > > to reproduce it, > > 1) deploy a fresh basex instance from latest snapshot ( > BaseX80-20140519.172557.zip<http://files.basex.org/releases/latest/BaseX80-20140519.172557.zip> > ) > 2) create an Empty database i.e. "sample" > 3) Add the below function to the restxq.xqm > > > declare %rest:path("test1") > %rest:POST("{$postbody}") > %rest:consumes("application/xml") > updating function page:upd($postbody) { > db:add("sample", document { $postbody } , "sample/dir1/doc1.xml") > }; > > 4) now you can test the xml to the restxq url > > url: http://localhost:8984/test1 > content-type : application/xml > > > <a b="1" c="2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<http://www.w3.org/2001/XMLSchema-instance> > > > <b> > <item x="1" w="2"/> > </b> > <n value="1" xsi:type="xs:string"/> > <n value="2" xsi:type="xs:string"/> > </a> > > or here is my complete basex instance which has only the above mentioned > modifications : > https://www.dropbox.com/s/yai9dx0smdj2ph9/test_basex.tar.gz > > To be sure, i used the out-of-package configuration i.e. didn't modified > any settings > > Thanks, > Seenivasan > > P.S : Platform: Linux > OpenJDK 1.7.0_51 > > > -- > > *Seenivasan Gunabalan* > [image: Dedalus S.p.A] > Via G. March 14/C, 57121 Livorno (Italy) > *email*: seenivasan.gunabalan at dedalus.eu >
CG
Christian Grün22 May 2014 10:15 #
To be fixed: https://github.com/BaseXdb/basex/issues/956
CG
...fixed; a new snapshot is available. Thanks for creating the reproducible example.
Christian
Quoted text · Marco Lettere · 72 lines
On Tue, May 20, 2014 at 3:18 PM, Marco Lettere <m.lettere at gmail.com> wrote: > Hello all, > we are investigating on the latest snapshot in order to check how our code > cleans up itself when reducing the overhead of the "updating" code by using > MIXED UPDATES. > We started experiencing the Index out of bound Exception on a particular > insert of a complex XML document. I worked heavily on reducing the document > to the smallest example that causes the exception getting to this: > > <a b="1" c="2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > <b> > <item x="1" w="2"/> > </b> > <n value="1" xsi:type="xs:string"/> > <n value="2" xsi:type="xs:string"/> > </a> > > Any change that reduces the XML causes the db:add to work. > > When inserting directly with db:add it works. > When putting the same db:add in a restxq it still works. > When passing the XML as postbody and putting the $postbody parameter in the > db:add the exception occurs. > > 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: basex-talk at mailman.uni-konstanz.de > 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: basex-talk at mailman.uni-konstanz.de > 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.
ML
Marco Lettere25 May 2014 19:46 #
Very good news! We'll proceed tomorrow with the testing!
Thanks.
M.
Quoted text · Christian Grün · 79 lines
On 25/05/2014 19:43, Christian Grün wrote: > ...fixed; a new snapshot is available. Thanks for creating the > reproducible example. > Christian > > > > On Tue, May 20, 2014 at 3:18 PM, Marco Lettere <m.lettere at gmail.com> wrote: >> Hello all, >> we are investigating on the latest snapshot in order to check how our code >> cleans up itself when reducing the overhead of the "updating" code by using >> MIXED UPDATES. >> We started experiencing the Index out of bound Exception on a particular >> insert of a complex XML document. I worked heavily on reducing the document >> to the smallest example that causes the exception getting to this: >> >> <a b="1" c="2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> >> <b> >> <item x="1" w="2"/> >> </b> >> <n value="1" xsi:type="xs:string"/> >> <n value="2" xsi:type="xs:string"/> >> </a> >> >> Any change that reduces the XML causes the db:add to work. >> >> When inserting directly with db:add it works. >> When putting the same db:add in a restxq it still works. >> When passing the XML as postbody and putting the $postbody parameter in the >> db:add the exception occurs. >> >> 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: basex-talk at mailman.uni-konstanz.de >> 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: basex-talk at mailman.uni-konstanz.de >> 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.
SA
Thanks a lot!
Best wishes,
Seenivasan
Quoted text · Christian Grün · 87 lines
On 25 May 2014 19:43, "Christian Grün" <christian.gruen at gmail.com> wrote: > ...fixed; a new snapshot is available. Thanks for creating the > reproducible example. > Christian > > > > On Tue, May 20, 2014 at 3:18 PM, Marco Lettere <m.lettere at gmail.com> > wrote: > > Hello all, > > we are investigating on the latest snapshot in order to check how our > code > > cleans up itself when reducing the overhead of the "updating" code by > using > > MIXED UPDATES. > > We started experiencing the Index out of bound Exception on a particular > > insert of a complex XML document. I worked heavily on reducing the > document > > to the smallest example that causes the exception getting to this: > > > > <a b="1" c="2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > > <b> > > <item x="1" w="2"/> > > </b> > > <n value="1" xsi:type="xs:string"/> > > <n value="2" xsi:type="xs:string"/> > > </a> > > > > Any change that reduces the XML causes the db:add to work. > > > > When inserting directly with db:add it works. > > When putting the same db:add in a restxq it still works. > > When passing the XML as postbody and putting the $postbody parameter in > the > > db:add the exception occurs. > > > > 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: basex-talk at mailman.uni-konstanz.de > > 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: basex-talk at mailman.uni-konstanz.de > > 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. >
Written for BaseX 7.8. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery