From: Thamm, R. <rus...@ds...> - 2007-05-09 01:11:36
|
Hi, another try=20 1) Execute following query in client let $c :=3D <xupdate:modifications version=3D"1.0" xmlns:xupdate=3D"http://www.xmldb.org/xupdate"> <xupdate:insert-before select=3D"/addresses"> <xupdate:processing-instruction name=3D"cocoon-process">type=3D"xsp"</xupdate:processing-instruction> </xupdate:insert-before> </xupdate:modifications> return $c Excerpt from exist.log 2007-05-07 10:31:14,017 [P1-8] DEBUG (XQuery.java [compile]:159) - Error compiling query: unexpected token: :=20 line 3:26: unexpected token: : at org.exist.xquery.parser.XQueryParser.attributeList(XQueryParser.java:933 5) at org.exist.xquery.parser.XQueryParser.elementWithAttributes(XQueryParser. java:9127) at org.exist.xquery.parser.XQueryParser.elementConstructor(XQueryParser.jav a:8141) at org.exist.xquery.parser.XQueryParser.elementContent(XQueryParser.java:96 94) at org.exist.xquery.parser.XQueryParser.mixedElementContent(XQueryParser.ja va:9307) at org.exist.xquery.parser.XQueryParser.elementWithAttributes(XQueryParser. java:9162) at org.exist.xquery.parser.XQueryParser.elementConstructor(XQueryParser.jav a:8141) at org.exist.xquery.parser.XQueryParser.elementContent(XQueryParser.java:96 94) at org.exist.xquery.parser.XQueryParser.mixedElementContent(XQueryParser.ja va:9307) at org.exist.xquery.parser.XQueryParser.elementWithAttributes(XQueryParser. java:9162) at org.exist.xquery.parser.XQueryParser.elementConstructor(XQueryParser.jav a:8141) at org.exist.xquery.parser.XQueryParser.directConstructor(XQueryParser.java :6950) at org.exist.xquery.parser.XQueryParser.primaryExpr(XQueryParser.java:6649) at org.exist.xquery.parser.XQueryParser.filterStep(XQueryParser.java:5807) at org.exist.xquery.parser.XQueryParser.stepExpr(XQueryParser.java:5769) at org.exist.xquery.parser.XQueryParser.relativePathExpr(XQueryParser.java: 5377) at org.exist.xquery.parser.XQueryParser.pathExpr(XQueryParser.java:5183) at org.exist.xquery.parser.XQueryParser.valueExpr(XQueryParser.java:5049) at org.exist.xquery.parser.XQueryParser.unaryExpr(XQueryParser.java:4626) at org.exist.xquery.parser.XQueryParser.castExpr(XQueryParser.java:4375) at org.exist.xquery.parser.XQueryParser.castableExpr(XQueryParser.java:4286 ) at org.exist.xquery.parser.XQueryParser.treatExpr(XQueryParser.java:4198) at org.exist.xquery.parser.XQueryParser.instanceofExpr(XQueryParser.java:41 11) at org.exist.xquery.parser.XQueryParser.intersectExceptExpr(XQueryParser.ja va:5328) at org.exist.xquery.parser.XQueryParser.unionExpr(XQueryParser.java:4834) at org.exist.xquery.parser.XQueryParser.multiplicativeExpr(XQueryParser.jav a:4769) at org.exist.xquery.parser.XQueryParser.additiveExpr(XQueryParser.java:4720 ) at org.exist.xquery.parser.XQueryParser.rangeExpr(XQueryParser.java:4645) at org.exist.xquery.parser.XQueryParser.comparisonExpr(XQueryParser.java:37 98) at org.exist.xquery.parser.XQueryParser.andExpr(XQueryParser.java:3769) at org.exist.xquery.parser.XQueryParser.orExpr(XQueryParser.java:3036) at org.exist.xquery.parser.XQueryParser.exprSingle(XQueryParser.java:2749) at org.exist.xquery.parser.XQueryParser.letVarBinding(XQueryParser.java:335 4) at org.exist.xquery.parser.XQueryParser.letClause(XQueryParser.java:3222) at org.exist.xquery.parser.XQueryParser.flworExpr(XQueryParser.java:2779) at org.exist.xquery.parser.XQueryParser.exprSingle(XQueryParser.java:2603) at org.exist.xquery.parser.XQueryParser.expr(XQueryParser.java:388) at org.exist.xquery.parser.XQueryParser.queryBody(XQueryParser.java:911) at org.exist.xquery.parser.XQueryParser.mainModule(XQueryParser.java:701) at org.exist.xquery.parser.XQueryParser.module(XQueryParser.java:613) at org.exist.xquery.parser.XQueryParser.xpath(XQueryParser.java:530) at org.exist.xquery.XQuery.compile(XQuery.java:131) at org.exist.xquery.XQuery.compile(XQuery.java:102) at org.exist.xquery.XQuery.compile(XQuery.java:93) at org.exist.xmlrpc.RpcConnection.compile(RpcConnection.java:308) at org.exist.xmlrpc.RpcConnection.compile(RpcConnection.java:1396) at org.exist.xmlrpc.RpcServer.compile(RpcServer.java:863) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.exist.xmlrpc.AuthenticatedHandler.execute(AuthenticatedHandler.java: 120) at org.exist.xmlrpc.AuthenticatedHandler.execute(AuthenticatedHandler.java: 67) at org.apache.xmlrpc.XmlRpcWorker.invokeHandler(XmlRpcWorker.java:128) at org.apache.xmlrpc.XmlRpcWorker.execute(XmlRpcWorker.java:185) at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:151) at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:139) at org.exist.xmlrpc.RpcServlet.doPost(RpcServlet.java:65) at javax.servlet.http.HttpServlet.service(HttpServlet.java:763) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:405) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationH andler.java:472) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:525) at org.mortbay.http.HttpContext.handle(HttpContext.java:1457) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationCon text.java:514) at org.mortbay.http.HttpContext.handle(HttpContext.java:1409) at org.mortbay.http.HttpServer.service(HttpServer.java:889) at org.mortbay.http.HttpConnection.service(HttpConnection.java:829) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:998) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:846) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244 ) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:345) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:530) 2) Execute following query in client=20 declare namespace xmldb=3D"http://exist-db.org/xquery/xmldb"; let $newdoc :=3D xmldb:store("/db","test.xml",<pedantic/>) let $pi :=3D <?xml-stylesheet type=3D"text/xsl" href=3D"http://hiexmldb:8080/schema/HostInfo.xsl"?> return update insert $pi preceding doc($newdoc)/document-node() Excerpt from exist.log java.lang.NullPointerException at org.exist.xquery.update.Insert.eval(Insert.java:158) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:56) at org.exist.xquery.PathExpr.eval(PathExpr.java:216) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:56) at org.exist.xquery.LetExpr.eval(LetExpr.java:154) at org.exist.xquery.LetExpr.eval(LetExpr.java:152) at org.exist.xquery.LetExpr.eval(LetExpr.java:152) at org.exist.xquery.BindingExpression.eval(BindingExpression.java:109) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:56) at org.exist.xquery.PathExpr.eval(PathExpr.java:216) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:56) at org.exist.xquery.XQuery.execute(XQuery.java:201) at org.exist.xquery.XQuery.execute(XQuery.java:171) at org.exist.xmlrpc.RpcConnection.doQuery(RpcConnection.java:253) at org.exist.xmlrpc.RpcConnection.queryP(RpcConnection.java:1469) at org.exist.xmlrpc.RpcConnection.queryP(RpcConnection.java:1436) at org.exist.xmlrpc.RpcServer.queryP(RpcServer.java:893) at org.exist.xmlrpc.RpcServer.queryP(RpcServer.java:875) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.exist.xmlrpc.AuthenticatedHandler.execute(AuthenticatedHandler.java: 120) at org.exist.xmlrpc.AuthenticatedHandler.execute(AuthenticatedHandler.java: 67) at org.apache.xmlrpc.XmlRpcWorker.invokeHandler(XmlRpcWorker.java:128) at org.apache.xmlrpc.XmlRpcWorker.execute(XmlRpcWorker.java:185) at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:151) at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:139) at org.exist.xmlrpc.RpcServlet.doPost(RpcServlet.java:65) at javax.servlet.http.HttpServlet.service(HttpServlet.java:763) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:405) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationH andler.java:472) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:525) at org.mortbay.http.HttpContext.handle(HttpContext.java:1457) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationCon text.java:514) at org.mortbay.http.HttpContext.handle(HttpContext.java:1409) at org.mortbay.http.HttpServer.service(HttpServer.java:889) at org.mortbay.http.HttpConnection.service(HttpConnection.java:829) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:998) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:846) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244 ) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:345) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:530) Replace "preceding" with "into" and the pi is inserted as the last child of the document node. 3) Following is a listing of the xupdate=20 <xupdate:modifications version=3D"1.0" xmlns:xupdate=3D"http://www.xmldb.org/xupdate" > <xupdate:insert-before select=3D"/document-node()"> <xupdate:processing-instruction name=3D"xml-stylesheet">type=3D"text/xml" href=3D"http://hiexmldb:8080/schema/HostInfo.xsl"</xupdate:processing-inst ruction> </xupdate:insert-before> </xupdate:modifications> Executing the XUpdate using the SOAP interface, I get a SOAP FAULT with faultstring of java.lang.NullPointerException. There appears to be no stack trace in the log file. Following is all the apparent output from the XUpdate operation: 2007-05-02 10:34:34,896 [P1-9] DEBUG (HttpConnection.java [<init>]:112) - new HttpConnection: Socket[addr=3D/131.185.87.211,port=3D1130,localport=3D8080]=20 2007-05-02 10:34:34,896 [P1-9] DEBUG (HttpConnection.java [readRequest]:875) - readRequest() ...=20 2007-05-02 10:34:34,896 [P1-9] DEBUG (HttpConnection.java [handleNext]:990) - REQUEST: POST /exist/services/Admin HTTP/1.0 Content-Type: text/xml; charset=3Dutf-8 Accept: application/soap+xml, application/dime, multipart/related, text/* User-Agent: Axis/1.3 Host: hiexmldb:8080 Cache-Control: no-cache Pragma: no-cache SOAPAction: "" Content-Length: 847 =20 2007-05-02 10:34:34,896 [P1-9] DEBUG (HttpServer.java [service]:873) - Contexts at /exist/services/Admin: [/exist/*=3D[WebApplicationContext[eXist XML Database,eXist XML Database]], /=3D[HttpContext[/]]]=20 2007-05-02 10:34:34,896 [P1-9] DEBUG (HttpServer.java [service]:887) - Try WebApplicationContext[eXist XML Database,eXist XML Database],0=20 2007-05-02 10:34:34,896 [P1-9] DEBUG (HttpContext.java [handle]:1456) - Handler org.mortbay.jetty.servlet.WebApplicationHandler in WebApplicationContext[eXist XML Database,eXist XML Database]=20 2007-05-02 10:34:34,896 [P1-9] DEBUG (ServletHandler.java [handle]:503) - servlet=3D/services/*=3DAxisServlet[org.apache.axis.transport.http.AxisServl et]=20 2007-05-02 10:34:34,896 [P1-9] DEBUG (ServletHandler.java [handle]:521) - session=3Dnull=20 2007-05-02 10:34:34,896 [P1-9] DEBUG (WebApplicationHandler.java [dispatch]:471) - call servlet AxisServlet[org.apache.axis.transport.http.AxisServlet]=20 2007-05-02 10:34:34,896 [P1-9] DEBUG (ServletHandler.java [getRealPath]:720) - getRealPath of /services/Admin in org.mortbay.jetty.servlet.WebApplicationHandler in WebApplicationContext[eXist XML Database,eXist XML Database]=20 2007-05-02 10:34:34,896 [P1-9] DEBUG (ContextLoader.java [getResource]:258) - try findResource META-INF/services/javax.xml.parsers.DocumentBuilderFactory from file:/C:/Program%20Files/eXist/webapp/WEB-INF/classes/=20 2007-05-02 10:34:34,911 [P1-9] DEBUG (ContextLoader.java [getResource]:272) - try getResource META-INF/services/javax.xml.parsers.DocumentBuilderFactory from java.net.URLClassLoader@a46701=20 2007-05-02 10:34:34,911 [P1-9] DEBUG (ContextLoader.java [getResource]:278) - found jar:file:/C:/Program%20Files/eXist/lib/endorsed/xercesImpl.jar!/META-INF /services/javax.xml.parsers.DocumentBuilderFactory=20 2007-05-02 10:34:34,911 [P1-9] DEBUG (ContextLoader.java [loadClass]:211) - try findClass org.apache.xerces.jaxp.DocumentBuilderFactoryImpl from file:/C:/Program%20Files/eXist/webapp/WEB-INF/classes/=20 2007-05-02 10:34:34,911 [P1-9] DEBUG (ContextLoader.java [loadClass]:227) - try loadClass org.apache.xerces.jaxp.DocumentBuilderFactoryImpl from java.net.URLClassLoader@a46701=20 2007-05-02 10:34:34,911 [P1-9] DEBUG (ContextLoader.java [loadClass]:230) - loaded class org.apache.xerces.jaxp.DocumentBuilderFactoryImpl=20 2007-05-02 10:34:34,911 [P1-9] DEBUG (ContextLoader.java [getResource]:258) - try findResource META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration from file:/C:/Program%20Files/eXist/webapp/WEB-INF/classes/=20 2007-05-02 10:34:34,911 [P1-9] DEBUG (ContextLoader.java [getResource]:272) - try getResource META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration from java.net.URLClassLoader@a46701=20 2007-05-02 10:34:34,911 [P1-9] DEBUG (ContextLoader.java [loadClass]:211) - try findClass org.apache.xerces.parsers.XIncludeAwareParserConfiguration from file:/C:/Program%20Files/eXist/webapp/WEB-INF/classes/=20 2007-05-02 10:34:34,911 [P1-9] DEBUG (ContextLoader.java [loadClass]:227) - try loadClass org.apache.xerces.parsers.XIncludeAwareParserConfiguration from java.net.URLClassLoader@a46701=20 2007-05-02 10:34:34,911 [P1-9] DEBUG (ContextLoader.java [loadClass]:230) - loaded class org.apache.xerces.parsers.XIncludeAwareParserConfiguration=20 2007-05-02 10:34:34,911 [P1-9] DEBUG (ContextLoader.java [loadClass]:211) - try findClass org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl from file:/C:/Program%20Files/eXist/webapp/WEB-INF/classes/=20 2007-05-02 10:34:34,911 [P1-9] DEBUG (ContextLoader.java [loadClass]:227) - try loadClass org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl from java.net.URLClassLoader@a46701=20 2007-05-02 10:34:34,911 [P1-9] DEBUG (ContextLoader.java [loadClass]:230) - loaded class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl=20 2007-05-02 10:34:34,927 [P1-9] DEBUG (XQuery.java [compile]:154) - Query diagnostics: [root-node]/child::document()=20 2007-05-02 10:34:34,927 [P1-9] DEBUG (XQuery.java [compile]:156) - Compilation took 16=20 2007-05-02 10:34:34,927 [P1-9] DEBUG (HTTPUtils.java [addLastModifiedHeader]:61) - mostRecentDocumentTime: 1133757588000=20 2007-05-02 10:34:34,927 [P1-9] DEBUG (Modification.java [select]:183) - found 1 for select: /document-node()=20 2007-05-02 10:34:34,927 [P1-9] DEBUG (Insert.java [process]:88) - found 1 nodes to insert=20 2007-05-02 10:34:34,942 [P1-9] DEBUG (HttpContext.java [handle]:1461) - Handled by org.mortbay.jetty.servlet.WebApplicationHandler in WebApplicationContext[eXist XML Database,eXist XML Database]=20 2007-05-02 10:34:34,942 [P1-9] DEBUG (HttpInputStream.java [resetStream]:153) - resetStream()=20 2007-05-02 10:34:34,942 [P1-9] DEBUG (HttpConnection.java [handleNext]:1084) - RESPONSE: HTTP/1.1 500 Internal Server Error Date: Wed, 02 May 2007 01:04:34 GMT Server: Jetty/5.0.0 (Windows XP/5.1 x86 java/1.5.0_06) Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: JSESSIONID=3Donoes4f75jhc;path=3D/exist Content-Type: text/xml; charset=3Dutf-8 Connection: close IMPORTANT: This email remains the property of the Australian Defence Organi= sation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1= 914. If you have received this email in error, you are requested to contac= t the sender and delete the email. |