Copied to clipboard

Flag this post as spam?

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


  • Pete 152 posts 176 karma points
    Aug 31, 2010 @ 11:16
    Pete
    0

    Null reference exception on CMS login

    The CMS had been running fine for months, client tried to log in this morning and got the following error:

     

    [NullReferenceException: Object reference not set to an instance of an object.]
       umbraco.BusinessLogic.Utils.TypeFinder.FindClassesOfType(Boolean useSeperateAppDomain) +27
       umbraco.BusinessLogic.Actions.Action.RegisterIActions() +71
       umbraco.BusinessLogic.Actions.Action..cctor() +150
    
    [TypeInitializationException: The type initializer for 'umbraco.BusinessLogic.Actions.Action' threw an exception.]
       umbraco.BusinessLogic.Actions.Action.GetJavaScriptFileReferences() +0
       umbraco.cms.presentation._umbraco.RenderActionJS() +47
       umbraco.cms.presentation._umbraco.Page_Load(Object sender, EventArgs e) +1050
       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) +99
       umbraco.BasePages.BasePage.OnLoad(EventArgs e) +15
       System.Web.UI.Control.LoadRecursive() +50
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

     

    Any ideas?

    Unfortunately I don't have any access to the db to check log files. 

  • Sebastiaan Janssen 5045 posts 15477 karma points MVP admin hq
    Aug 31, 2010 @ 11:20
    Sebastiaan Janssen
    0

    That usually means the user name and password combination is wrong..

  • Pete 152 posts 176 karma points
    Aug 31, 2010 @ 11:25
    Pete
    0

    I get the same error when I browse to it now, so presumably I've been authenticated and the problem is on CMS load?

    This is umbraco v 4.0.3 (Assembly version: 1.0.3625.27276)

    I don't think this version had the old incorrect login error?

  • Sebastiaan Janssen 5045 posts 15477 karma points MVP admin hq
    Aug 31, 2010 @ 11:47
    Sebastiaan Janssen
    0

    Ah yes, that problem was fixed in 4.0.3 (or a little before, not sure). 

    Since the error is in FindClassesOfType, it looks like something is wrong with your bin folder or something? Maybe permissions.. (yes, they do tend to "magically" change sometimes).

    This is the function that fails:

           /// <summary>
            /// Searches all loaded assemblies for classes of the type passed in.
            /// </summary>
            /// <typeparam name="T">The type of object to search for</typeparam>
            /// <param name="useSeperateAppDomain">true if a seperate app domain should be used to query the types. This is safer as it is able to clear memory after loading the types.</param>
            /// <returns>A list of found types</returns>
            public static List<Type> FindClassesOfType<T>(bool useSeperateAppDomain)
            {
                if (useSeperateAppDomain)
                {
                    string binFolder = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, "bin");
                    string[] strTypes = TypeResolver.GetAssignablesFromType<T>(binFolder, "*.dll");
    
                    List<Type> types = new List<Type>();
    
                    foreach (string type in strTypes)
                        types.Add(Type.GetType(type));
    
                    return types;
                }
                else
                    return FindClassesOfType(typeof(T));
            }

    Line 27 is this line:

                    string binFolder = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, "bin");

    I think you should ask your provider to see if the permissions are still correct and if the whole bin folder actually still exists.

  • Pete 152 posts 176 karma points
    Aug 31, 2010 @ 15:14
    Pete
    0

    Indeed, permissions had "magically" disappeared. 

    Working now, cheers!

Please Sign in or register to post replies

Write your reply to:

Draft