4

I have a custom list with around 250+ columns.

I have customized the new, edit and display forms of the list. I used more xsl templates to display all the columns in DataFormWebPart.

But after some updates of SharePoint, my new form is returning to error page.

MetadataNavigationContext Page_InitComplete: No XsltListViewWebPart was found on this page["custom form URL"].  Hiding key filters and downgrading tree functionality to legacy ListViewWebPart(v3) level for this list.

Error while executing web part: System.StackOverflowException: Operation caused a stack overflow.    
 at Microsoft.Xslt.NativeMethod.CheckForSufficientStack()    
 at <xsl:template name="dvt_1.rowedit">(XmlQueryRuntime , XPathNavigator , Double , Double )    
 at <xsl:template name="dvt_1.body">(XmlQueryRuntime , XPathNavigator , Double , IList`1 )    
 at <xsl:template name="dvt_1">(XmlQueryRuntime , XPathNavigator , Double )    
 at Root(XmlQueryRuntime )    
 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, XmlWriter results)    
 at Microsoft.SharePoint.WebPartPages.DataFormWebPart.ExecuteTransform(XslCompiledTransform xslCompiledTransform, XsltArgumentList xmlArguments, Boolean bDeferExecuteTransform)    
 at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)

This issue is being observed after august updates. Please help me....

1

8 Answers 8

2

I also ran into this error message when upgrading a 2007 site to 2010. A custom list had a custom edit form. There are about 150 fields in this list. It appears the error message is caused by the time it takes the DataFormWebPart to render out the content.

You can find some details of the error here on TechNet.

http://social.technet.microsoft.com/Forums/en-US/sharepoint2010customization/thread/ad13e5e4-e211-453f-bfef-fe260591154a

In the OP, the stack trace is located at CheckForSufficientStack(). The code below was posted by the thread above after looking into the assemblies with reflector to see what that method is doing...

public static unsafe void CheckForSufficientStack()
{
    void* stackBarrier = StackBarrier;
    if (dateTime < DateTime.Now)
    {
        throw new StackOverflowException();
    }
    if (&stackBarrier < stackBarrier)
    {
        throw new StackOverflowException();
    }
} 

and back in SP1...

public static unsafe void CheckForSufficientStack()
{
    void* stackBarrier = StackBarrier;
    if (((++callCount & 0xffff) == 0) && (dateTime.AddSeconds(5.0) < DateTime.Now))
    {
        throw new StackOverflowException();
    }
    if (&stackBarrier < stackBarrier)
    {
        throw new StackOverflowException();
    }
}

So SP1 added a check that if it takes > 5 seconds, throw the Exception. Now, I believe that time has been reduced to a SINGLE SECOND. So if it takes more than a second to render your content (and that's likely with 100 fields), you'll get this exception.

I have been able to work around this issue by way of InfoPath.

I am positive if you were to comment out in the markup for the DataFormWebPart, all but just 10 or so fields, you won't have any errors...Uncomment the rest, and the issue will return.

5

Microsoft has released a posibility to modify the xslt-timeout in their latest CU. There you can modify the XsltTimeOut:

$farm = Get-SPFarm
$farm.XsltTransformTimeOut = 5
$farm.Update()
2
  • To use this you need to contact Microsoft to get this file: sharepointfoundation2010-kb2597136-fullfile-x64-glb.exe, in order to use above example or download it here
    – user2536
    Sep 24, 2012 at 11:59
  • That did the trick for me on 2016 dev farm. Unfortunately, the ops team on my side wont run this script! But, I confirm this worked Mar 14, 2021 at 21:09
3

We attempted to use BCS and found that the response rate for queries over 10 records was inordinately slow versus what logic tells you should be the response rate for queries. We have since banned the use of BCS in our SharePoint environment and favor WebApi JSON for data requests. It is orders of magnitude faster and more flexible.

3

You can simply the custom xsl by removing fields like FieldDescription. This fixed the issue for me. My page has more than 80 controls.

1

I get the same issue however when I refresh the page it goes away.

Almost seems like a caching issue to me.

My situation: I customized the XSLT on the XsltListViewWebPart web part. As soon as I make a change to the xsl the error comes back and when I hit the page again it goes away.

0

The best way to work around this issue is the following:

1.) Sub class the DataForm Web Part. Override the following methods. Then Deploy the assembly. Example:

public class customDFWP : DataFormWebPart
     {
         public override bool IsGhosted
         {
             get
             {
                 return true;
             }
         }
         public override bool CanHaveServerControls
         {
             get
             {
                 return true;
             }
         }
     }

2.) Add a safe control entry to the web.config Example:

<SafeControl Assembly="customDFWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=963f869a440db619" Namespace="customDFWP" TypeName="*" Safe="True" AllowRemoteDesigner="True" SafeAgainstScript="False"/>

3.) Add the following to the element of the web.config Example:

<add tagType="Microsoft.SharePoint.WebPartPages.DataFormWebPart, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" mappedTagType="customDFWP.customDFWP, customDFWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=963f869a440db619" />

4.) Register the assembly on the form page. Example:

<%@ Register tagprefix="customDFWP" namespace="customDFWP" assembly="customDFWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=963f869a440db619" %>

5.) On the form page find and replace it with the new custom tag.Example:

<customDFWP:customDFWP>

This is described in the following KB-article: http://support.microsoft.com/kb/2639184

0

I have the same issue. Sharepoint log tells more:

Error while executing web part: System.StackOverflowException: Operation caused a stack overflow.     at Microsoft.Xslt.NativeMethod.CheckForSufficientStack()     at <xsl:apply-templates mode="Lookup_body">(XmlQueryRuntime , XPathNavigator , XPathNavigator )     at <xsl:template match="FieldRef" name="FieldRef_PrintField" mode="PrintField">(XmlQueryRuntime , XPathNavigator , XPathNavigator , Double , String )     at <xsl:apply-templates mode="PrintFieldWithECB">(XmlQueryRuntime , XPathNavigator , XPathNavigator )     at <xsl:template match="FieldRef" name="FieldRef_printTableCell_EcbAllowed" mode="printTableCellEcbAllowed">(XmlQueryRuntime , XPathNavigator , XPathNavigator , String )     at <xsl:template match="Row" mode="Item">(XmlQueryRuntime , XPathNavigator , IList`1 , IList`1 , Double... f02b0a05-b76e-4b91-8587-c70ca13d2011
10/04/2011 13:56:25.96* w3wp.exe (0x1084)                           0x14C8  SharePoint Foundation           Web Parts                       89a1    High        ... , Double )     at <xsl:template match="View" mode="RenderView">(XmlQueryRuntime , XPathNavigator )     at <xsl:template match="View" mode="full">(XmlQueryRuntime , XPathNavigator , String )     at <xsl:template match="View" name="View_Default_RootTemplate" mode="RootTemplate">(XmlQueryRuntime , XPathNavigator , String )     at <xsl:template match="/">(XmlQueryRuntime )     at Root(XmlQueryRuntime )     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, XsltArgu...  f02b0a05-b76e-4b91-8587-c70ca13d2011
10/04/2011 13:56:25.96* w3wp.exe (0x1084)                           0x14C8  SharePoint Foundation           Web Parts                       89a1    High        ...mentList arguments, XmlWriter results)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.ExecuteTransform(XslCompiledTransform xslCompiledTransform, XsltArgumentList xmlArguments, Boolean bDeferExecuteTransform)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)   f02b0a05-b76e-4b91-8587-c70ca13d2011

The problem disappears when I limit elements in list from 1000 to 100.

0
0

So to expand a little on Kjaps answer I would like to offer the following, given that the link for better information is now well dead and Microsoft, and the work around hotfix is not available neither from Microsoft or anywhere I could think to download it from. The year is now 2022 and almost no one runs SharePoint 2010 anymore. (Well except me, but I am fast moving away from it)

First, you will need Visual Studio. I used VS2010. Then build a "C#\Sharepoint\2010\Empty Sharepoint Project" project. Give a Name, Something other than "customDFWP", please. That is because if you name the Project customDFWP and the class customDFWP, it will become confusing how to build the various strings that you need to use later to enable the work around. For that reason the solution provided by Kjaps is simply horrible because without the KB Article that is now gone, you will have a hard time piecing it all together. It was probably fine in 2012. Step 1 is missing the "End Class". Step 2 is done automatically when you deploy from visual studio or install the WSP file in your target server. The publickey will be unique to your solution. "AllowRemoteDesigner" is not needed. Step 3 is not needed if you don't want to deploy the patched version to everything on your server, in most cases, this is the case. Step 4 is where it get's interesting. My version read <%@ Register tagprefix="MEMSDFWP" namespace="MEMSDFWP.customDFWP" assembly="MEMSDFWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3620837a1dd37165" %>

because my projectname was MEMSDFWP and the namespace is MEMSDFWP.customDFWP. in my code customDFWP is the name of the class.... what I replaced was <WebPartPages:DataFormWebPart{all your code} with <MEMSDFWP:customDFWP{all your code} and then modified the closing tag. This is clearer when you don't name the project customDFWP. Hope this helps someone, as I first attempted this approach 3 years ago and got nowhere, and this year it came up again, and I figured to give it a go and got it to work, SANS getting access to the hotfix, this is actually the best solution. (save getting rid of sharepoint)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.