Re: Null-Reference Exception at loading CuteChat time

  •  02-14-2007, 11:27 AM

    Re: Null-Reference Exception at loading CuteChat time

     
    Hi
     
    Thanks for your reply. I have adapted our implementation of the IHttpApplicationUserAdapter interface so all exceptions are caught.  This is how we implemented it:

    public
    class CustomUserAdapter : CuteSoft.Chat.UserAdapter {

       public override string GetUserUniqueName( HttpContext context ) {

          try{

             FrameworkUserDTO currentUser = UserInfoProvider.GetFrameworkUser();

             return currentUser.Id.ToString();

          }catch{

             return null;

          }   

       }

    }
     
     
    Unfortunately, even after this implementation we experience the same problem. After a deployment or when the worker process is recycled the CuteChat application sometimes has trouble loading or initialising. If this has happened once, CuteChat does not recover until the next IIS restart. In a productive environment this is a big problem.  It really seems to me that this is a problem of initialization. When the initialization phase is over without any errors, CuteChat works fine. However, if an exception occurs, CuteChat cannot recover. The exception that is written to the log file is the following:  
     
    <Exception>
      <Description>An exception of type 'System.Web.HttpUnhandledException' occurred and was caught.</Description>
      <DateTime>2007-02-14 17:10:11Z</DateTime>
      <ExceptionType>System.Web.HttpUnhandledException, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</ExceptionType>
      <Message>Exception of type 'System.Web.HttpUnhandledException' was thrown.</Message>
      <Source>System.Web</Source>
      <HelpLink />
      <Property name="ErrorCode">-2147467259</Property>
      <Property name="Data">System.Collections.ListDictionaryInternal</Property>
      <Property name="TargetSite">Boolean HandleError(System.Exception)</Property>
      <StackTrace>   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.ProcessRequestWithNoAssert(HttpContext context)
       at System.Web.UI.Page.ProcessRequest(HttpContext context)
       at ASP.cutesoft_client_cutechat_im_chatform_aspx.ProcessRequest(HttpContext context)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)</StackTrace>
      <additionalInfo>
        <info name="MachineName" value="PRIME-DEV" />
        <info name="TimeStamp" value="14.02.2007 16:10:11" />
        <info name="FullName" value="EnterpriseLibrary.ExceptionHandling, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
        <info name="AppDomainName" value="/LM/W3SVC/1292483567/Root-2-128159429884466188" />
        <info name="ThreadIdentity" value="" />
        <info name="WindowsIdentity" value="NT AUTHORITY\NETWORK SERVICE" />
      </additionalInfo>
      <InnerException>
        <ExceptionType>System.NullReferenceException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
        <Message>Object reference not set to an instance of an object.</Message>
        <Source>CuteSoft.Chat</Source>
        <HelpLink />
        <Property name="Data">System.Collections.ListDictionaryInternal</Property>
        <Property name="TargetSite">System.Collections.Specialized.NameValueCollection GetConfigs()</Property>
        <StackTrace>   at CuteSoft.Chat.ChatDataManager.GetConfigs()
       at CuteSoft.Chat.ChatDataManager.GetConfig(String configname)
       at CuteSoft.Chat.ChatApiImpl.DoGetConfig(String name)
       at CuteSoft.Chat.ChatApiImpl.GetConfig(String name)
       at CuteSoft.Chat.ChatWebUtility.GetUserAdapter()
       at CuteSoft.Chat.ChatWebUtility.get_CurrentIdentity()
       at CuteSoft.Chat.Impl.ResourceContext.LoadResources(CultureInfo ci)
       at CuteSoft.Chat.UI.ChatPageBase.Render(HtmlTextWriter writer)
       at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)</StackTrace>
      </InnerException>
    </Exception>
    <env_info>
    <entry name="request.URL"><![CDATA[/CuteSoft_Client/CuteChat/IM_ChatForm.Aspx?UserId=17&DisplayName=J%FCrg%20Balmeruss%20-%20SWI&_t1171469411010]]></entry>
    <entry name="request.method"><![CDATA[GET]]></entry>
    <entry name="request.path"><![CDATA[/CuteSoft_Client/CuteChat/IM_ChatForm.Aspx]]></entry>
    <entry name="request.ePrime.name"><![CDATA[]]></entry>
    <entry name="request.params"><![CDATA[UserId=17;DisplayName=Jrg Balmeruss - SWI;=_t1171469411010;]]></entry>
    <entry name="lastSqlStatement"><![CDATA[No sql statements available]]></entry>
    <entry name="request.cookies"><![CDATA[ASP.NET_SessionId=fohxws45d10m1bmul4cweg45;.LOGINUSER=D2AB01301A21E19C472F42FA0DCBC7B73DA4D9137AA3C027E2D669A2CA64E4851DC9244360E5802736D44860F28B97F1E14E8FE7C760D20E85346B774C6CCA3D;year_dropdown_preset=2007;body_dropdown_preset=3;advanced_history_body_dropdown_preset=2;CuteChatIMMainForm=Here;]]></entry>
    <entry name="windows.identity"><![CDATA[NT AUTHORITY\NETWORK SERVICE]]></entry>
    <entry name="user.Agent"><![CDATA[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.04506.30)]]></entry>
    <entry name="user.HostAddress"><![CDATA[192.168.2.145]]></entry>
    <entry name="user.HostName"><![CDATA[192.168.2.145]]></entry>
    <entry name="browser.JScriptVersion"><![CDATA[5.6]]></entry>
    <entry name="browser.JavaApplets"><![CDATA[True]]></entry>
    <entry name="browser.MajorVersion"><![CDATADevil]></entry>
    <entry name="browser.MinorVersion"><![CDATA[0]]></entry>
    <entry name="application.version"><![CDATA[4.07.00]]></entry>
    </env_info>
     
     
    Please have a look at it as we cannot go online like this.
     
    Thanks
     
    Daniel
     
View Complete Thread