Tuesday 24 September 2013

SharePoint 2010 - "Unable to display this Web Part"


                                  I was using web parts in a page and i had faced this problem. It was telling that "Unable to Display this web part. To trouble shoot the problem, open this Web Page in Microsoft Sharepoint Foundation - compatible HTML editor such as Microsoft Sharepoint Designer. If the problem persists contact your web server administrator. Corelation ID : 7acacbd8...  "



                                 When i look in the error log using the Correlation ID, I get this.


Error while executing web part: System.StackOverflowException: Operation caused a stack overflow.     at Microsoft.Xslt.NativeMethod.CheckForSufficientStack()     at <xsl:template match="FieldRef[@Name='Author']" name="FieldRef_header.Author" mode="header">(XmlQueryRuntime , XPathNavigator , Double )     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.XmlILComman...        7acacbd8-e819-4018-ae84-1900dd9c10e4


                               It tells me that stack over flow exception has occurred. Now when i refresh the page for the second time the web part works fine for me. The problem is only when the page is initially loaded.

                              The problem is a XSLT extension method taking long time to complete. in SP2010 SP1 the SharePoint team introduced a check in the XSLT Transformations done by data from web part and thereby in search core results webpart, that the latest extension method has to complete within 1 second of the first being invoked otherwise they throw StackOverflow Exception. The solution is changing the duration of the webparts in all forms available from 1 second to 5 seconds. To do so follow the method.

1) Locate Sharepoint 2010 Management Shell 

2) Paste the following script and enter

$farm = Get-SPFarm 
$farm.XsltTransformTimeOut = 5 
$farm.Update()

This will change the timeout from 1 second to 5 seconds which gets us some time so that StackOverflow Exception wont occur.






No comments:

Post a Comment