From: Alejandro G. G. <ale...@in...> - 2017-08-31 07:50:21
|
Testing a custom API in eXistdb 3.4.1 I've found an issue related to the XQuery update extension module. When we perform a query like: update value $doc/icom:*/@id with $id The result is an unhandled exception like: 2017-08-29 14:29:45,642 [qtp510673578-36] ERROR (XQueryServlet.java [process]:534) - null java.lang.NullPointerException: null at org.exist.dom.persistent.StoredNode.getParentNode(StoredNode.java:245) ~[exist.jar:3.4.1] at org.exist.dom.persistent.StoredNode.getPath(StoredNode.java:384) ~[exist.jar:3.4.1] at org.exist.indexing.lucene.LuceneIndexWorker.getReindexRoot(LuceneIndexWorker.java:244) ~[exist-index-lucene.jar:3.4.1] at org.exist.indexing.IndexController.getReindexRoot(IndexController.java:274) ~[exist.jar:3.4.1] at org.exist.indexing.IndexController.getReindexRoot(IndexController.java:258) ~[exist.jar:3.4.1] at org.exist.dom.persistent.ElementImpl.updateChild(ElementImpl.java:1391) ~[exist.jar:3.4.1] at org.exist.xquery.update.Update.eval(Update.java:170) ~[exist.jar:3.4.1] at org.exist.xquery.LetExpr.eval(LetExpr.java:99) ~[exist.jar:3.4.1] at org.exist.xquery.LetExpr.eval(LetExpr.java:111) ~[exist.jar:3.4.1] at org.exist.xquery.LetExpr.eval(LetExpr.java:111) ~[exist.jar:3.4.1] at org.exist.xquery.LetExpr.eval(LetExpr.java:111) ~[exist.jar:3.4.1] at org.exist.xquery.UserDefinedFunction.eval(UserDefinedFunction.java:156) ~[exist.jar:3.4.1] at org.exist.xquery.DynamicCardinalityCheck.eval( DynamicCardinalityCheck.java:74) ~[exist.jar:3.4.1] at org.exist.xquery.DynamicTypeCheck.eval(DynamicTypeCheck.java:61) ~[exist.jar:3.4.1] at org.exist.xquery.FunctionCall.evalFunction(FunctionCall.java:302) ~[exist.jar:3.4.1] at org.exist.xquery.FunctionCall.eval(FunctionCall.java:223) ~[exist.jar:3.4.1] at org.exist.xquery.LetExpr.eval(LetExpr.java:99) ~[exist.jar:3.4.1] at org.exist.xquery.LetExpr.eval(LetExpr.java:111) ~[exist.jar:3.4.1] at org.exist.xquery.LetExpr.eval(LetExpr.java:111) ~[exist.jar:3.4.1] at org.exist.xquery.LetExpr.eval(LetExpr.java:111) ~[exist.jar:3.4.1] at org.exist.xquery.LetExpr.eval(LetExpr.java:111) ~[exist.jar:3.4.1] at org.exist.xquery.UserDefinedFunction.eval(UserDefinedFunction.java:156) ~[exist.jar:3.4.1] at org.exist.xquery.DynamicCardinalityCheck.eval( DynamicCardinalityCheck.java:74) ~[exist.jar:3.4.1] at org.exist.xquery.DynamicTypeCheck.eval(DynamicTypeCheck.java:61) ~[exist.jar:3.4.1] at org.exist.xquery.FunctionCall.evalFunction(FunctionCall.java:302) ~[exist.jar:3.4.1] at org.exist.xquery.FunctionCall.eval(FunctionCall.java:223) ~[exist.jar:3.4.1] at org.exist.xquery.LetExpr.eval(LetExpr.java:99) ~[exist.jar:3.4.1] at org.exist.xquery.LetExpr.eval(LetExpr.java:111) ~[exist.jar:3.4.1] at org.exist.xquery.LetExpr.eval(LetExpr.java:111) ~[exist.jar:3.4.1] at org.exist.xquery.LetExpr.eval(LetExpr.java:111) ~[exist.jar:3.4.1] at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) ~[exist.jar:3.4.1] at org.exist.xquery.PathExpr.eval(PathExpr.java:276) ~[exist.jar:3.4.1] at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) ~[exist.jar:3.4.1] at org.exist.xquery.XQuery.execute(XQuery.java:253) ~[exist.jar:3.4.1] at org.exist.xquery.XQuery.execute(XQuery.java:185) ~[exist.jar:3.4.1] at org.exist.http.servlets.XQueryServlet.process(XQueryServlet.java:470) [exist-optional.jar:3.4.1] at org.exist.http.servlets.XQueryServlet.doPost(XQueryServlet.java:191) [exist-optional.jar:3.4.1] at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [servlet-api-3.1.jar:3.1.0] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [servlet-api-3.1.jar:3.1.0] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:566) [jetty-security-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.server.session.SessionHandler. doHandle(SessionHandler.java:226) [jetty-server-9.3.9.v20160517. jar:9.3.9.v20160517] at org.eclipse.jetty.server.handler.ContextHandler. doHandle(ContextHandler.java:1174) [jetty-server-9.3.9.v20160517. jar:9.3.9.v20160517] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.server.session.SessionHandler. doScope(SessionHandler.java:185) [jetty-server-9.3.9.v20160517. jar:9.3.9.v20160517] at org.eclipse.jetty.server.handler.ContextHandler. doScope(ContextHandler.java:1106) [jetty-server-9.3.9.v20160517. jar:9.3.9.v20160517] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:159) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:74) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517] at org.exist.http.urlrewrite.Forward.doRewrite(Forward.java:50) [exist-optional.jar:3.4.1] at org.exist.http.urlrewrite.XQueryURLRewrite.doRewrite(XQueryURLRewrite.java:545) [exist-optional.jar:3.4.1] at org.exist.http.urlrewrite.XQueryURLRewrite.service(XQueryURLRewrite.java:349) [exist-optional.jar:3.4.1] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [servlet-api-3.1.jar:3.1.0] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.servlet.ServletHandler$CachedChain. doFilter(ServletHandler.java:1689) [jetty-servlet-9.3.9. v20160517.jar:9.3.9.v20160517] at de.betterform.agent.web.filter.XFormsFilter.doFilter(XFormsFilter.java:171) [betterform-exist-5.1-SNAPSHOT-20160615.jar:?] at org.eclipse.jetty.servlet.ServletHandler$CachedChain. doFilter(ServletHandler.java:1668) [jetty-servlet-9.3.9. v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) [jetty-security-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.server.session.SessionHandler. doHandle(SessionHandler.java:226) [jetty-server-9.3.9.v20160517. jar:9.3.9.v20160517] at org.eclipse.jetty.server.handler.ContextHandler. doHandle(ContextHandler.java:1174) [jetty-server-9.3.9.v20160517. jar:9.3.9.v20160517] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.server.session.SessionHandler. doScope(SessionHandler.java:185) [jetty-server-9.3.9.v20160517. jar:9.3.9.v20160517] at org.eclipse.jetty.server.handler.ContextHandler. doScope(ContextHandler.java:1106) [jetty-server-9.3.9.v20160517. jar:9.3.9.v20160517] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle( ContextHandlerCollection.java:213) [jetty-server-9.3.9.v20160517. jar:9.3.9.v20160517] at org.eclipse.jetty.server.handler.HandlerCollection. handle(HandlerCollection.java:119) [jetty-server-9.3.9.v20160517. jar:9.3.9.v20160517] at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:396) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.server.Server.handle(Server.java:524) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) [jetty-io-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) [jetty-io-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [jetty-io-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume. executeProduceConsume(ExecuteProduceConsume.java:303) [jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume. produceConsume(ExecuteProduceConsume.java:148) [jetty-util-9.3.9.v20160517. jar:9.3.9.v20160517] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run( ExecuteProduceConsume.java:136) [jetty-util-9.3.9.v20160517. jar:9.3.9.v20160517] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517] at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517] at java.lang.Thread.run(Unknown Source) [?:1.8.0_131] And the running script stops executing without further details. After some tests, I've found that this is caused because we're trying to update an attribute in our custom XML namespace, but If I apply the same operation on a document in the default XML namespace, everything works correctly. Is this a known bug? Is it a bad use from our end? Thanks, -- Alejandro Gonzalez Gutierrez Consultant santander t: ES +34942284639 t: NL +31172700547 *w: * www.incentro.com santander office luis riera vega 10 | santander 39012 | spain [image: incentro] <http://www.incentro.com> <https://www.incentro.com/es/?utm_source=e-mail&utm_medium=e-mailbanner&utm_campaign=E-mailbanner%20kom%20kletsen&utm_content=Santander> |