Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Henrik Bro 18 posts 38 karma points
    Nov 15, 2009 @ 13:19
    Henrik Bro
    0

    Object reference not set to an instance of an object

    Perhaps someone tried this before?

    It started out when I added a property to a master-documenttype.

    I noticed that it did not show up on all my nodes (that documenttype)

    Then I tried to delete the property, but it failed with: Object reference not set to an instance of an object.

    Now all the nodes with the buggy documenttype are shown as: "Object reference not set to an instance of an object" when loading from the Umbraco GUI.

    Pages are still showing as normal.

    I can get the error to go away (for some time) if I publish the top-node and all sub-nodes.

    Object reference not set to an instance of an object, are also showing when I try to delete a package from "Created packages".

    Umbraco: 4.0.2.1
    dotNET: 3.5
    IIS: 7
    OS: Win2008srv

    Any help are most welcome :)

    /henrik

     

    Error in Umbraco

    Server Error in '/' Application.
    ________________________________________
    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.]
       umbraco.controls.ContentControl.addControlNew(Property p, TabPage tp, String Caption) +54
       umbraco.controls.ContentControl..ctor(Content c, publishModes CanPublish, String Id) +782
       umbraco.cms.presentation.editContent.OnInit(EventArgs e) +368
       System.Web.UI.Control.InitRecursive(Control namingContainer) +333
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378

    ________________________________________
    Version Information: Microsoft .NET Framework Version:2.0.50727.4200; ASP.NET Version:2.0.50727.4016

     

     


    Error from IE (trying to delete from "Created packages"

    Brugeragent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2)
    Tidsstempling: Sun, 15 Nov 2009 10:05:49 UTC


    Meddelelse: Sys.Net.WebServiceFailedException: The server method 'Delete' failed with the following error: System.NullReferenceException-- Object reference not set to an instance of an object.
    Linje: 4723
    Tegn: 21
    Kode: 0
    URI: http://dfs.local/ScriptResource.axd?d=pAzdlfmOOKuK0X3z3U0M0LakJko0vX15h1_V7pbdtdr_8_ssG1lK82CeguKrmKPffzx5_5AoEdW7FnsY9jlJ76qzqwIMW3ShqhvzVnq1lM01&t=2ead55ef

  • Ronnie Hegelund 48 posts 710 karma points
    Nov 15, 2009 @ 14:57
    Ronnie Hegelund
    0

    I have tryed something similar long ago, I solved it by deleting a few rows in the DB, think it was in the PropertyData table.

    /Ronnie

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Nov 16, 2009 @ 09:45
    Richard Soeteman
    0

    Hi Hendrik,

    I had the same issue a few weeks back and wrote a blogpost how to solve it. Hope it helps you.

    Cheers,

    Richard

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Nov 17, 2009 @ 12:09
    Jesper Ordrup
    0

    @ronnie: which rows did you delete? :-)

    @Richard: So adding this little thingie might help, you think?

    obj = c.getProperty(this);

    if (obj != null)

       obj.delete();

     

    /Jesper

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Nov 17, 2009 @ 16:34
    Jesper Ordrup
    1

    I did some testing with Henrik's solution. It seems that there's some datainconsistency that makes some trouble.

    I've not been able to clean the database enough to make the error dissapear but I've looked into how controls are added to the page. I've just added a check if the property is really there.

    In ContentControl.cs's constructor (in from umbraco.presentation) the following line:

    addControlNew(cp, tp, t.Caption);

     

    Is changed to:  

    Property cp = _content.getProperty(pt);

    if (cp != null)
        addControlNew(cp, tp, t.Caption);
    else
        Log.Add(LogTypes.Error, _content.Id, "Property not found. Alias=" + pt.Alias + ", id=" + pt.Id + ", contenttypeid=" + pt.ContentTypeId);

     

    As a result the page is rendered and editable in Umbraco GUI. I've not tested it that much but it seems to do the trick.

    /Jesper

     

  • Anders Stentebjerg 58 posts 234 karma points
    Jun 30, 2010 @ 12:59
    Anders Stentebjerg
    0

    Hi, guys.

    I thought this was fixed in 4.5 but I still get the same error when I add the data type (ImageCropper) for my media type (Image)

    Can I use the same fix as above? (Can not immediately locate the files)

    /Anders

  • Brian Manning 22 posts 43 karma points
    Jul 27, 2010 @ 00:16
    Brian Manning
    0

    I wanted to add that I was receiving this same problem and doing a an iireset fixed the problem (it was a full iisreset, not just the site, fyi - might have worked for just the site also, but I'm not sure).

  • Kevon K. Hayes 255 posts 281 karma points
    Jul 30, 2010 @ 01:43
    Kevon K. Hayes
    0

    Brian --

    What version are you on?

  • Brian Manning 22 posts 43 karma points
    Jul 30, 2010 @ 17:07
    Brian Manning
    0

    I'm on 4.0.3 right now.

  • Sebastian Dammark 581 posts 1385 karma points
    May 11, 2011 @ 20:24
    Sebastian Dammark
    0

    Hello folks

    Let me raise this one from the grave ...

    I'm on 4.7.0 and I just deleted a document property and created a new one.  First with the same alias and then with another, but either way gives me the attached error.

    If the property is located on the 'Generic Properties' tab, it doesn't fail, but the property is hidden or gone so to speak.
    If I move the property to a tab that is inherited from my master document, I get the attached error.

    The original property was the DAMP- Media picker, but the new one is the uComponents - MultiNode Tree Picker.

    My biggets problem is that the site is almost finished, and right now I cannot pick any media because of this error or create a new document that uses this document property.
    So folks, I really need your help on this one.

     

  • kris 5 posts 25 karma points
    Oct 18, 2011 @ 16:01
    kris
    0

    Hi,

    Please can any one help?

    I am upgrading from 4.0.4.2 to 4.5. I have taken full copy of files and datbase and doing upgradation on back up. After 3rd step of upgradation, i am getting 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.]
    umbraco.presentation.install.steps.defaultUser.Page_Load(Object sender, EventArgs e) +106
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
    System.Web.UI.Control.OnLoad(EventArgs e) +91
    System.Web.UI.Control.LoadRecursive() +74
    System.Web.UI.Control.LoadRecursive() +146
    System.Web.UI.Control.LoadRecursive() +146
    System.Web.UI.Control.LoadRecursive() +146
    System.Web.UI.Control.LoadRecursive() +146
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

     

    Thanks

    Krishna

  • kris 5 posts 25 karma points
    Nov 23, 2011 @ 15:49
    kris
    0

    Any information regardin this

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Nov 23, 2011 @ 15:57
    Tom Fulton
    0

    Sounds like maybe you didn't copy all the required files for the upgrade, are you sure copied the /bin/, /install/, /umbraco/ and /umbraco_client/ folders?  There are also some changes in the configs but I think this error is probably related to the install folder

  • dinesh 2 posts 22 karma points
    Mar 24, 2012 @ 09:47
    dinesh
    0

    i also get same error

    my code is here ,

    <form runat="server" id="aaass">

        <asp:ScriptManager runat="server">

        </asp:ScriptManager>

        <umbraco:Macro PollNodeId="1218" DisplayOnly="1" SubmitOnSelect="1" HideSubmit="1" SortResults="1" WidthTotalVotes="1" HideQuestion="1" RandomPoll="1" Alias="Poll" runat="server"></umbraco:Macro>

    </form>

    tell me any change in code

     

    Thanks 

    again

     

  • jeeshna 6 posts 26 karma points
    Sep 05, 2012 @ 09:16
    jeeshna
    0

    Hi,

    Due to performance issue , I have added the publishing code in thread

     

     try

                        {

                            HttpontextforMailSending gethttpcontextforpublish2 = new HttpontextforMailSending()

                            {

                                HttpContextReference = HttpContext.Current,

                                courseDocument = shortCourseDocument,

                                createdUser = new User(0)

                            };

                            Thread t2 = new Thread(PublishDocument);

                            t2.Start(gethttpcontextforpublish2);

                        }

                        catch

                        {

                        }

     

     

     

     private void PublishDocument(object input)

            {

                HttpontextforMailSending httpcontextformail = (HttpontextforMailSending)input;

                Document course = httpcontextformail.courseDocument;

                User createduser = httpcontextformail.createdUser;

                if (course != null && createduser != null)

                {

                    course.Publish(createduser);

                    umbraco.library.UpdateDocumentCache(course.Id);

                }

     

            }

     

     

     

    public class HttpontextforMailSending

        {

            public HttpContext HttpContextReference { get; set; }       

            public Document courseDocument { get; set; }

            public User createdUser { get; set; }

        }

     

     

    but i got "Object reference not set to an instance of an object" error on "course.Publish(createduser);"

     

    Please anyone help me to solving this.

     

    Thanks

    Jeeshna

Please Sign in or register to post replies

Write your reply to:

Draft