From: Thomas W. <tho...@gm...> - 2008-06-03 19:18:29
|
Dear all, I have a XQuery that runs fine when it is executed on its own. When I schedule multiple instances of this XQuery, after couple of executions I receive on the eXist command window number of java errors (strangely enough they are not recorded in exist.log). I have attached a zip file with the code that will reproduce the errors. 1. Please unzip the files with the directory structure in .../webapp/hpSpy 2. Set the correct password in xmldb:login( "/db", "admin", "pass" ) in fetch-section.xql, fetch-category.xql, select-category.xql and batch.xql 2. Execute fetch-section.xql first. It will create all initial data structures. 3. Start the code with batch.xql?mode=start 4. Observe eXist command window for errors 5. Stop the code with batch.xql?mode=stop Increasing the value of $max-job-per-section at line 120 in batch.xql will manifest the problems quicker. This is a short explanation what batch.xql does: For each section created by fetch-section.xql (at the moment they are 5), it creates $max-job-per-section instances of a dynamically created XQuery that executes select-category.xql with the section id passed as a parameter. These XQueries are saved in the database and scheduled to be executed shortly. When select-category.xql picks up the first category for update from the passed section and executes fetch-category. When a scheduled XQuery is called it logs the call in /db/hpSpy/log/amazon/batch/{section-id}-{instance}.xml select-category.xql and select-category.xql can be run without parameters manually. I wrote my first QXuery just 6 weeks ago (and I love it!) and the world of JAVA is very new to me. Some of these errors may be trivial оr may be are caused by my lack of understanding how eXist works. For me at this moment they are real show stopper. I will really appreciate any help and advice. The top ten lines of the error messages follow bellow. Regards, Thomas ------------------------------------------- [Fatal Error] :836:45: Open quote is expected for attribute "href" associated with an element type "a". java.lang.NullPointerException at org.exist.stax.EmbeddedXMLStreamReader.readNodeId(EmbeddedXMLStreamReader.java:194) at org.exist.stax.EmbeddedXMLStreamReader.initNode(EmbeddedXMLStreamReader.java:165) at org.exist.stax.EmbeddedXMLStreamReader.next(EmbeddedXMLStreamReader.java:221) at org.exist.storage.dom.DOMFile.findValue(DOMFile.java:1348) at org.exist.storage.dom.RawNodeIterator.seek(RawNodeIterator.java:135) at org.exist.stax.EmbeddedXMLStreamReader.reposition(EmbeddedXMLStreamReader.java:134) at org.exist.storage.NativeBroker.getXMLStreamReader(NativeBroker.java:529) ... java.lang.NullPointerException at org.exist.stax.EmbeddedXMLStreamReader.getAttributeCount(EmbeddedXMLStreamReader.java:286) at org.exist.dom.NodeProxy.directSelectAttribute(NodeProxy.java:1301) at org.exist.dom.NodeSetHelper.directSelectAttributes(NodeSetHelper.java:548) at org.exist.dom.AbstractNodeSet.directSelectAttribute(AbstractNodeSet.java:301) at org.exist.xquery.LocationStep.getAttributes(LocationStep.java:475) at org.exist.xquery.LocationStep.eval(LocationStep.java:317) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:59) at org.exist.xquery.PathExpr.eval(PathExpr.java:238) at org.exist.xquery.LetExpr.eval(LetExpr.java:150) at org.exist.xquery.LetExpr.eval(LetExpr.java:201) ... java.lang.ClassCastException: org.exist.memtree.ElementImpl at org.exist.xquery.value.ValueSequence.toNodeSet(ValueSequence.java:207) at org.exist.xquery.LocationStep.eval(LocationStep.java:296) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:59) at org.exist.xquery.PathExpr.eval(PathExpr.java:238) at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:96) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:59) at org.exist.xquery.PathExpr.eval(PathExpr.java:238) at org.exist.xquery.LetExpr.eval(LetExpr.java:150) at org.exist.xquery.LetExpr.eval(LetExpr.java:201) at org.exist.xquery.LetExpr.eval(LetExpr.java:201) at org.exist.xquery.LetExpr.eval(LetExpr.java:201) ... java.lang.NullPointerException at org.exist.xquery.functions.transform.Transform$CachedStylesheet.getTemplates(Transform.java:401) at org.exist.xquery.functions.transform.Transform$CachedStylesheet.<init>(Transform.java:386) at org.exist.xquery.functions.transform.Transform.getSource(Transform.java:346) at org.exist.xquery.functions.transform.Transform.createHandler(Transform.java:291) at org.exist.xquery.functions.transform.Transform.eval(Transform.java:187) at org.exist.xquery.BasicFunction.eval(BasicFunction.java:68) at org.exist.xquery.InternalFunctionCall.eval(InternalFunctionCall.java:49) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:59) at org.exist.xquery.PathExpr.eval(PathExpr.java:238) at org.exist.xquery.LetExpr.eval(LetExpr.java:150) at org.exist.xquery.LetExpr.eval(LetExpr.java:201) ... java.util.NoSuchElementException at org.exist.stax.EmbeddedXMLStreamReader.next(EmbeddedXMLStreamReader.java:219) at org.exist.dom.NodeProxy.directSelectAttribute(NodeProxy.java:1298) at org.exist.dom.NodeSetHelper.directSelectAttributes(NodeSetHelper.java:548) at org.exist.dom.AbstractNodeSet.directSelectAttribute(AbstractNodeSet.java:301) at org.exist.xquery.LocationStep.getAttributes(LocationStep.java:475) at org.exist.xquery.LocationStep.eval(LocationStep.java:317) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:59) at org.exist.xquery.PathExpr.eval(PathExpr.java:238) ... java.lang.NullPointerException at org.exist.dom.NodeProxy.getNode(NodeProxy.java:347) at org.exist.dom.ExtArrayNodeSet.item(ExtArrayNodeSet.java:397) at org.exist.xquery.update.Modification.selectAndLock(Modification.java:150) at org.exist.xquery.update.Delete.eval(Delete.java:123) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:59) .. -- Thomas White 51 Glebewood Bracknell Berks RG12 9SD Mobile:+44 7711 922 966 Skype: thomaswhite gTalk: thomas.0007 jaxtr: http://www.jaxtr.com/t.white Linked-In:http://www.linkedin.com/in/thomaswhite0007 -- Thomas White 51 Glebewood Bracknell Berks RG12 9SD Mobile:+44 7711 922 966 Skype: thomaswhite gTalk: thomas.0007 jaxtr: http://www.jaxtr.com/t.white Linked-In:http://www.linkedin.com/in/thomaswhite0007 |