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(

Information Technology Services

209 Durham



From: Michael Kay []
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:



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




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

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



        at net.sf.saxon.dom.NodeWrapper$ChildEnumeration.skipFollowingTextNodes(

        at net.sf.saxon.dom.NodeWrapper$



        at net.sf.saxon.dom.NodeWrapper.copy(

        at net.sf.saxon.event.ComplexContentOutputter.append(

        at net.sf.saxon.expr.Expression.process(

        at net.sf.saxon.instruct.ElementCreator.processLeavingTail(

        at net.sf.saxon.instruct.Block.processLeavingTail(

        at net.sf.saxon.instruct.Instruction.process(

        at net.sf.saxon.instruct.ElementCreator.processLeavingTail(

        at net.sf.saxon.instruct.Choose.processLeavingTail(

        at net.sf.saxon.instruct.Instruction.process(


        at edu.iastate.its.thinkspace.core.SpaceModel.execute(