+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Object reference not set to an instance of an object.

Object reference not set to an instance of an object.

5 posts, 0 answered
  1. Justin
    Justin avatar
    9 posts
    Registered:
    05 Sep 2007
    06 Mar 2008
    Link to this post
     Hey guys,


    Twiice in the last 2 days our home page has failed with the following error:

    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
       Nolics.ORMapper.DataProviders.SQLDataProvider.ParseResult(Int32 fromRow, Int32 maxRows, DataSet dsResult, IDataReader rd) +484
       Nolics.ORMapper.DataProviders.SQLDataProvider.ExecuteKeyQuery(DataSet queries, Boolean fPrimaryKey) +262
       Nolics.ORMapper.DataProviders.SQLDataProvider.QueryByPrimaryKey(DataSet keys) +7
       Nolics.ORMapper.Base.PrimeryKeyQuery.LoadPKQuery() +38
       Nolics.ORMapper.Base.OdbClass.LoadByPrimaryKey(IOdbClass primaryKey, OdbDataProvider provider, ObDataCache cache) +79
       Telerik.Cms.Engine.Data.Providers.DefaultProvider.GetContent(Guid id) +183
       Telerik.Cms.Engine.ContentManager.GetContent(Guid id) +41
       Telerik.Cms.Engine.WebControls.GenericContent.Render(HtmlTextWriter writer) +352
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
       System.Web.UI.Control.Render(HtmlTextWriter writer) +7
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
       System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +59
       System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +68
       System.Web.UI.Adapters.ControlAdapter.Render(HtmlTextWriter writer) +18
       Telerik.Cms.Web.FormAdapter.Render(HtmlTextWriter writer) +125
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +2113233
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
       System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +37
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
       System.Web.UI.Control.Render(HtmlTextWriter writer) +7
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
       System.Web.UI.Page.Render(HtmlTextWriter writer) +26
       Telerik.Cms.Web.InternalPage.Render(HtmlTextWriter writer) +285
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1896
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

    This error does not go way until I Restart the IIS server. We are running SiteFinity 3.1. Any idea what is going on?
  2. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    07 Mar 2008
    Link to this post
    Hello Justin,

    Have you, by any chance deleted the template your home page uses? Or has anyone edited its template recently?

    With version 3.1 SP2 you may get this error at the Pages > Site Map tab, when you select a page whose template has been deleted. The only way out of this is to delete the page. In version 3.2, the error that is displayed in this case is more informative, it states: 
    The file '/[YourProjectName]/App_Master/NameOfMsterpage.master' does not exist. 

    The error can also be displayed is when the <form> tag is missing in the master page.
    The error is thrown at the Pages > Templates tab, after clicking Edit for a template.
    To eliminate the problem:

       1. Open the .master file your template is using.
       2. Make sure that it contains the @ Master directive, as well as all of the top-level HTML elements for a page, such as <html>, <head> and <form>.
    For more details, please refer to the MSDN library: ASP.NET Master Pages.

    If your case is different, please give us more information about the steps you took before the error occured.

    On a side note, did the Value cannot be null.Parameter name: virtualPath error go away and did you upgrade to the latest release>?

    Looking forward to your reply,
    Rebecca
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Justin
    Justin avatar
    9 posts
    Registered:
    05 Sep 2007
    07 Mar 2008
    Link to this post
    I am not sure of the casue of the error. To fix it I just restarted IIS. It has been 24 hours since the last time I saw the error.
  4. briankb
    briankb avatar
    56 posts
    Registered:
    23 Feb 2004
    13 Mar 2008
    Link to this post
    Other than deleting the page and recreating the page. What is the fix for this?

    Templates can not be updated. So the only choice is to delete it and create a new one with the same name. However this does not resolve correctly even when the template has the exact same name as the previously deleted one.

    We have a sitefinity site with 50+ pages, EACH page is a lot of work to just recreate. We need to be able to update masterpages/templates within sitefinity and if one is delete it shouldn't just error out (good error info or not).
  5. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    13 Mar 2008
    Link to this post
    Hi Briankb,

    When the .master file is edited outside Sitefinity, the templates should be automatically updated after an application restart.

    We are working on the fix for the problem with deleted templates at the moment.
    Until the fix is available, to get rid of this error "The file '/[YourProjectName]/App_Master/Master.master' does not exist", you need to create a .master file with the same name in the App_Master folder. Then, when you select the page in the sitemap, you'll be able to go to Edit page mode and select a template. Upload the masterpage first at the Templates tab, so it appears in the Page Template dropdown.

    Let us know if you need any further assistance.

    All the best,
    Rebecca
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
5 posts, 0 answered