Note that there are some explanatory texts on larger screens.

plurals
  1. PO.Net Null Reference Exception in DocumentXPathNavigator
    primarykey
    data
    text
    <p>I've run into an interesting exception. On one of my production servers, occasionally I'll get the following exception. </p> <pre><code>System.NullReferenceException: Object reference not set to an instance of an object. at System.Xml.DocumentXPathNavigator.get_NameTable() at System.Xml.Xsl.Runtime.XmlQueryContext.get_DefaultNameTable() at System.Xml.Xsl.Runtime.XmlQueryRuntime..ctor(XmlQueryStaticData data, Object defaultDataSource, XmlResolver dataSources, XsltArgumentList argList, XmlSequenceWriter seqWrt) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter) at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) at sftControls.SearchListLandingPage.getHtml(IXPathNavigable document, String Xsl, String headerLinks) </code></pre> <p>Opening up the IL and looking through each method suggests that the DocumentXPathNavigator => this.document is null. What's strange is that I can in no way duplicate this issue locally or on our test servers.</p> <p>A little background, and this might be the key... This is a web application(running .Net 3.5) that caches the XmlDocument that gets passed into XslCompiledTransform.Transform(). Our caching is serviced through a distributed cache server. The XmlDocument is serialized and cached so a reference to the specific object should not continue to exist. That leads me to believe that either something is explicitly preventing this.document from ever being set when the implicit XmlDocument -> DocumentXPathNavigator happens or some reference somewhere is removed while the Transform() is running. Either way I am perplexed.</p> <p>So, I guess my questions are:</p> <ol> <li>Has anyone else seen this before?</li> <li>Does anyone know what could be causing it or how to deal with it?</li> </ol> <p>Thanks</p> <p><b>EDIT:</b><br/> After further thinking about this, the only thing that would make sense is that it's a race condition. The caching appliance is somehow expiring the object while the application is using the object.</p> <p><b>EDIT/EDIT:</b><br/> .Net 3.5, the assembilies being referenced above are 2.0</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload