November Happy Hour will be moved to Thursday December 5th.

pappabj0rn
Mar 22, 2010
  5757
(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 SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog

I'm running Optimizely CMS on .NET 9!

It works 🎉

Tomas Hensrud Gulla | Nov 12, 2024 | Syndicated blog

Recraft's image generation with AI-Assistant for Optimizely

Recraft V3 model is outperforming all other models in the image generation space and we are happy to share: Recraft's new model is now available fo...

Luc Gosso (MVP) | Nov 8, 2024 | Syndicated blog