Try our conversational search powered by Generative AI!

pappabj0rn
Mar 22, 2010
  5659
(1 votes)

NullReferenceException in EnsureAllPageTypeProperties()

Last night while working on one of my sites, I needed to go into edit mode and have a look at my site structure. I was greeted by this lovely error message instead of my page tree:

System.NullReferenceException: Object reference not set to an instance of an object.
   at EPiServer.Core.PropertyDataCollection.EnsureAllPageTypeProperties()
   at EPiServer.Core.PropertyDataCollection.InitializeData()
   at EPiServer.Core.PageData.InitializeData(IList`1 pageLanguages)
   at EPiServer.DataAccess.PageListDB.ReadPageList(AbstractCommand cmd)
   at EPiServer.DataAccess.PageListDB.<>c__DisplayClass11.<LoadSpecificPages>b__10()
   at EPiServer.DataAccess.DataAccessBase.<>c__DisplayClass1`1.<Execute>b__0()
   at EPiServer.DataAccess.DatabaseFactory.Execute[TResult](Action`1 method)
   at EPiServer.DataAccess.DataAccessBase.Execute[TResult](Action`1 action)
   at EPiServer.LocalPageProvider.GetPages(PageReferenceCollection pageReferences, ILanguageSelector selector)
   at EPiServer.Core.PageProviderBase.GetScatteredPages(PageReferenceCollection pageRefs, ILanguageSelector selector)
   at EPiServer.Core.PageProviderBase.GetChildren(PageReference pageLink, ILanguageSelector selector, Int32 startIndex, Int32 maxRows)
   at EPiServer.DataFactory.GetChildren(PageReference pageLink, ILanguageSelector selector, Int32 startIndex, Int32 maxRows)
   at EPiServer.DataFactory.GetChildren(PageReference pageLink, ILanguageSelector selector)
   at EPiServer.Web.WebControls.PageDataSource.GetChildrenForLoader(PageReference pageLink)
   at EPiServer.Web.WebControls.HierarchicalPageLoader.GetFilteredChildren(PageReference pageLink)
   at EPiServer.Web.WebControls.PageHierarchyData.EnsureChildrenLoaded()
   at EPiServer.Web.WebControls.PageHierarchyData.get_HasChildren()
   at EPiServer.UI.WebControls.PageTreeView.PopulateChildNodes(IHierarchicalEnumerable enumerable, Int32 depth, Int32 expandDepth, PageTreeNode parentNode, ArrayList populationPath)
   at EPiServer.UI.WebControls.PageTreeView.PopulateChildNodes(IHierarchicalEnumerable enumerable, Int32 depth, Int32 expandDepth, PageTreeNode parentNode, ArrayList populationPath)
   at EPiServer.UI.WebControls.PageTreeView.PopulateChildNodes(IHierarchicalEnumerable enumerable, Int32 depth, Int32 expandDepth, PageTreeNode parentNode, ArrayList populationPath)
   at EPiServer.UI.WebControls.PageTreeView.PopulateRecursive(String viewPath)
   at EPiServer.UI.WebControls.PageTreeView.PerformDataBinding()
   at System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect()
   at EPiServer.UI.Edit.PageExplorer.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   --- End of inner exception stack trace ---
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.gui_edit_edittree_aspx.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Then I remembered, “oh, yeah… the tree broke down when I upgraded to R2 sp2 last week”. I didn’t have much choice but to tend to my page tree.

The stack trace doesn’t give you much info as to what went wrong, but it also so happens that I use Allan’s DCPlugin (which took down my site after the upgrade – fixed it by adding a quick check-for-null-patch), which, just like EnsureAllPageTypeProperties(), juggles with PropertyData. All of this indicates that something is wrong with some of my property types (property plug-ins), and sure enough, after modifying DCPlugin to throw me some detailed info, I found that some modules I was using didn’t work in my current sp2 installation. After removing the corresponding dlls, and the definitions in my database, my page tree sprung to life once more.

I’m not sure what was wrong with the modules, and since I’m not sure I’ll be using them I have yet to give a damn.

Bottom line

If something goes wrong in EPiServer.Core.PropertyDataCollection.EnsureAllPageTypeProperties(), something is wrong with your property type(s).

Mar 22, 2010

Comments

Please login to comment.
Latest blogs
Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog