SaaS CMS has officially launched! Learn more now.

pappabj0rn
Mar 22, 2010
  5706
(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 Concepts and Terminologies

Whether you're a new user of Optimizely CMS or a veteran who have been through the evolution of it, the SaaS CMS is bringing some new concepts and...

Patrick Lam | Jul 15, 2024

How to have a link plugin with extra link id attribute in TinyMce

Introduce Optimizely CMS Editing is using TinyMce for editing rich-text content. We need to use this control a lot in CMS site for kind of WYSWYG...

Binh Nguyen Thi | Jul 13, 2024

Create your first demo site with Optimizely SaaS/Visual Builder

Hello everyone, We are very excited about the launch of our SaaS CMS and the new Visual Builder that comes with it. Since it is the first time you'...

Patrick Lam | Jul 11, 2024

Integrate a CMP workflow step with CMS

As you might know Optimizely has an integration where you can create and edit pages in the CMS directly from the CMP. One of the benefits of this i...

Marcus Hoffmann | Jul 10, 2024

GetNextSegment with empty Remaining causing fuzzes

Optimizely CMS offers you to create partial routers. This concept allows you display content differently depending on the routed content in the URL...

David Drouin-Prince | Jul 8, 2024 | Syndicated blog

Product Listing Page - using Graph

Optimizely Graph makes it possible to query your data in an advanced way, by using GraphQL. Querying data, using facets and search phrases, is very...

Jonas Bergqvist | Jul 5, 2024