1
votes

I'm hoping you can help me. I'm getting the Object reference error on a webserver which contains an application we run.

Someone reset it this week and updated the server with (about) 50 new updates. I know. terrible. Anyway.. since then we're getting this error.

Server Error in '/' Application.

Object reference not set to an instance of an object.

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

Source Error:

Line 36: Hashtable items = mc.LanguageController.GetLanguageItems(ClientConfiguration.Language, languageItems);

Line 37: XmlElement itemsElem = doc.CreateElement("Lang");

Line 38: doc.DocumentElement.AppendChild(itemsElem);

Source File: c:\inetpub\wwwroot\xxxxxxxx\www\App_Code\Rendering\Rendering.cs Line: 36

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]

Rendering.GetRootDocument(String[] languageItems, IMainController mc) in c:\inetpub\wwwroot\xxxxxxxxxxxx\www\App_Code\Rendering\Rendering.cs:36

Rendering.GetDefaultDocument(IMainController mc) in c:\inetpub\wwwroot\xxxxxxxxxxxx\www\App_Code\Rendering\Rendering.cs:53

_Default.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\xxxxxxxxxxxx\www\Default.aspx.cs:31

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

System.Web.UI.Control.LoadRecursive() +50

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

Version Information: Microsoft .NET Framework Version:2.0.50727.4216; ASP.NET Version:2.0.50727.4223

I've checked the Event log as well:

Event code: 3005

Event message: An unhandled exception has occurred.

Event time: 29-3-2012 12:47:38

Event time (UTC): 29-3-2012 10:47:38

Event ID: 69890cf8cf244b18a5adcbd29ae9a189

Event sequence: 25

Event occurrence: 8

Event detail code: 0

Application information:

Application domain: /LM/W3SVC/2/ROOT-3-129774906346518390

Trust level: Full

Application Virtual Path: /

Application Path: C:\inetpub\wwwroot\xxxxxxxx\www\

Machine name: WIN-PKNHIWTOENT

Process information:

Process ID: 4288

Process name: w3wp.exe

Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:

Exception type: NullReferenceException

Exception message: Object reference not set to an instance of an object.

Request information:

Request URL: http://xxxxxxxx/default.aspx

Request path: /default.aspx

User host address: yyy.yyy.yyy.yyy

User:

Is authenticated: False

Authentication Type:

Thread account name: NT AUTHORITY\NETWORK SERVICE

Thread information:

Thread ID: 8

Thread account name: NT AUTHORITY\NETWORK SERVICE

Is impersonating: False

Stack trace: at Rendering.GetRootDocument(String[] languageItems, IMainController mc) in c:\inetpub\wwwroot\xxxxxxxxxxxx\www\App_Code\Rendering\Rendering.cs:line 36

at Rendering.GetDefaultDocument(IMainController mc) in c:\inetpub\wwwroot\xxxxxxxxxxxx\www\App_Code\Rendering\Rendering.cs:line 53

at _Default.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\xxxxxxxxxxxx\www\Default.aspx.cs:line 31

at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)

at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)

at System.Web.UI.Control.OnLoad(EventArgs e)

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I suspect it's the languageItems variable, which is being passed from another function:

public static XmlDocument GetOverviewDocument(IMainController mc) {

   string[] languageItems = { 

      "usermanagement", 

      "customermanagement", 

      "ordermanagement", 

      "ordermanagement LB", 

      "systemmanagement",

      "qualitymanagement",

      "overview",

      "loggedinas",

      "logout",

      "Change password",

      "managementoverview"

  };

 XmlDocument doc = GetRootDocument(languageItems, mc);

 return doc;

}

Since I'm not an ASP guru like most of you I have no idea what's actually happening here; whether it's something to do with the updates to .NET which were installed, if it's code-syntax related or if there's a simple config mistake in web.config which I'm overlooking.

Any help would be most, MOST appreciated.

1

1 Answers

0
votes

o, so:
Line 36: Hashtable items = mc.LanguageController.GetLanguageItems(ClientConfiguration.Language, languageItems);

Are sure that it's languageitems variable? Because I'm starting to think that mc could null or ClientConfiguration(if it's property).