Yes, I had seen similar reports of errors.  I will see if there is a possibility of multiple threads accessing the same DOM.  I suspected there might be a timing issue if a single user made two requests at the same time on that DOM.  That might be the problem.

 

 

Pete Boysen(pboysen@iastate.edu)

Information Technology Services

209 Durham

(515)294-6663

 

From: Michael Kay [mailto:mike@saxonica.com]
Sent: Thursday, March 28, 2013 12:41 PM
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] NPE in NodeWrapper

 

 



This failure is remarkably similar to this one:

 

https://saxonica.plan.io/boards/3/topics/5571?r=5577#message-5577

 

 

which is occurring in Saxon 9.2 and is currently unresolved (and is also intermittent). The relevant code in NodeWrapper is:

 

final int len = childNodesLength;

            while (pos < len) {

                Node node = childNodes.item(pos);

                short kind = node.getNodeType();

 

and the last line appears to be failing because variable node is null.

 

The code in question is still the same in 9.4 (and 9.5), so there don't appear to be any known bugs in this area.

 

Is there any possibility that the DOM is being used in more than one thread? The DOM is not thread-safe, even in read-only mode (because reads cause updating side-effects by way of lazy evaluation).

 

Michael Kay

Saxonica

 

 

On 28 Mar 2013, at 17:00, Boysen, Pete [ITACD] wrote:



I am using 9.1.0.8 with Xerces and getting the following intermittent error. Most of the time it works fine.

 

java.lang.NullPointerException

        at net.sf.saxon.dom.NodeWrapper$ChildEnumeration.skipFollowingTextNodes(NodeWrapper.java:1142)

        at net.sf.saxon.dom.NodeWrapper$ChildEnumeration.next(NodeWrapper.java:1169)

        at net.sf.saxon.om.Navigator$AxisFilter.next(Navigator.java:885)

        at net.sf.saxon.om.Navigator.copy(Navigator.java:566)

        at net.sf.saxon.dom.NodeWrapper.copy(NodeWrapper.java:848)

        at net.sf.saxon.event.ComplexContentOutputter.append(ComplexContentOutputter.java:491)

        at net.sf.saxon.expr.Expression.process(Expression.java:476)

        at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)

        at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)

        at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)

        at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)

        at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:686)

        at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)

        at net.sf.saxon.query.XQueryExpression.run(XQueryExpression.java:394)

        at edu.iastate.its.thinkspace.core.SpaceModel.execute(SpaceModel.java:241)