NPE in DataBuilder.stripNS() during RESTPost.run() with rest:context provided
Friday, 24 February 2012 · 3 messages
CD
Charles Duffy24 Feb 2012 04:59 #
Howdy --
I'm getting a stack trace putting the following query (exact, unmodified) through the REST POST interface on a BaseX snapshot as of this morning:
$ curl -X POST -T - -H 'Content-Type: application/xml' \
http://admin:admin@localhost:8984/rest <<EOF
<rest:query xmlns:rest="http://basex.org/rest">
<rest:text>
/
</rest:text>
<rest:context>
<root>
<foobar:root xmlns:foobar="http://example.com/foobar">
<foobar:b/><foobar:b/><foobar:b/>
</foobar:root>
</root>
</rest:context>
</rest:query>
EOF
Unexpected error: null(yes, it requires _three_ of the <foobar:b/> elements before this happens -- execution is fine with just two)
Improper use? Potential bug? Your feedback is welcome:
Contact: basex-talk at mailman.uni-konstanz.de
Version: BaseX 7.1.2 beta
[6/1859]
Java: Oracle Corporation, 1.7.0_02
OS: Linux, amd64
Stack Trace:
java.lang.NullPointerException
org.basex.data.NSNode.delete(NSNode.java:103)
org.basex.data.NSNode.delete(NSNode.java:103)
org.basex.data.NSNode.delete(NSNode.java:103)
org.basex.data.Namespaces.delete(Namespaces.java:198)
org.basex.query.util.DataBuilder.stripNS(DataBuilder.java:313) org.basex.api.rest.RESTPost.run(RESTPost.java:121)
org.basex.api.rest.RESTServlet.run(RESTServlet.java:64)
org.basex.api.rest.RESTServlet.doPost(RESTServlet.java:30) javax.servlet.http.HttpServlet.service(HttpServlet.java:727) ...
CG
Christian Grün24 Feb 2012 13:10 #
..I managed to reproduce this issue; seems to be related to [1], so I guess it has been recently introduced with a snapshot. I'll give you feedback soon.
Christian
Quoted text · Charles Duffy · 53 lines
On Fri, Feb 24, 2012 at 3:58 AM, Charles Duffy <charles at dyfis.net> wrote: > Howdy -- > > I'm getting a stack trace putting the following query (exact, unmodified) > through the REST POST interface on a BaseX snapshot as of this morning: > > $ curl -X POST -T - -H 'Content-Type: application/xml' \ > http://admin:admin@localhost:8984/rest <<EOF > <rest:query xmlns:rest="http://basex.org/rest"> > <rest:text> > / > </rest:text> > <rest:context> > <root> > <foobar:root xmlns:foobar="http://example.com/foobar"> > <foobar:b/><foobar:b/><foobar:b/> > </foobar:root> > </root> > </rest:context> > </rest:query> > EOF > Unexpected error: null > > (yes, it requires _three_ of the <foobar:b/> elements before this happens -- > execution is fine with just two) > > Improper use? Potential bug? Your feedback is welcome: > Contact: basex-talk at mailman.uni-konstanz.de > Version: BaseX 7.1.2 beta > > > > [6/1859] > Java: Oracle Corporation, 1.7.0_02 > OS: Linux, amd64 > Stack Trace: > java.lang.NullPointerException > org.basex.data.NSNode.delete(NSNode.java:103) > org.basex.data.NSNode.delete(NSNode.java:103) > org.basex.data.NSNode.delete(NSNode.java:103) > org.basex.data.Namespaces.delete(Namespaces.java:198) > org.basex.query.util.DataBuilder.stripNS(DataBuilder.java:313) > org.basex.api.rest.RESTPost.run(RESTPost.java:121) > org.basex.api.rest.RESTServlet.run(RESTServlet.java:64) > org.basex.api.rest.RESTServlet.doPost(RESTServlet.java:30) > javax.servlet.http.HttpServlet.service(HttpServlet.java:727) > ... > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
CG
Christian Grün24 Feb 2012 15:09 #
Dear Charles,
the problem should now be fixed, just as the issue reported by Andy [1]. Once again, you are invited to check out the latest snapshot [2].
Christian
[1] https://github.com/BaseXdb/basex/issues/397
[2] http://files.basex.org/releases/latest/
Quoted text · Charles Duffy · 53 lines
> On Fri, Feb 24, 2012 at 3:58 AM, Charles Duffy <charles at dyfis.net> wrote: >> Howdy -- >> >> I'm getting a stack trace putting the following query (exact, unmodified) >> through the REST POST interface on a BaseX snapshot as of this morning: >> >> $ curl -X POST -T - -H 'Content-Type: application/xml' \ >> http://admin:admin@localhost:8984/rest <<EOF >> <rest:query xmlns:rest="http://basex.org/rest"> >> <rest:text> >> / >> </rest:text> >> <rest:context> >> <root> >> <foobar:root xmlns:foobar="http://example.com/foobar"> >> <foobar:b/><foobar:b/><foobar:b/> >> </foobar:root> >> </root> >> </rest:context> >> </rest:query> >> EOF >> Unexpected error: null >> >> (yes, it requires _three_ of the <foobar:b/> elements before this happens -- >> execution is fine with just two) >> >> Improper use? Potential bug? Your feedback is welcome: >> Contact: basex-talk at mailman.uni-konstanz.de >> Version: BaseX 7.1.2 beta >> >> >> >> [6/1859] >> Java: Oracle Corporation, 1.7.0_02 >> OS: Linux, amd64 >> Stack Trace: >> java.lang.NullPointerException >> org.basex.data.NSNode.delete(NSNode.java:103) >> org.basex.data.NSNode.delete(NSNode.java:103) >> org.basex.data.NSNode.delete(NSNode.java:103) >> org.basex.data.Namespaces.delete(Namespaces.java:198) >> org.basex.query.util.DataBuilder.stripNS(DataBuilder.java:313) >> org.basex.api.rest.RESTPost.run(RESTPost.java:121) >> org.basex.api.rest.RESTServlet.run(RESTServlet.java:64) >> org.basex.api.rest.RESTServlet.doPost(RESTServlet.java:30) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:727) >> ... >> >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >>
Written for BaseX 7.1. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery