"Object set Connection Failed.. Object reference not set to an instance of an object" error?

  •  04-06-2005, 11:36 AM

    "Object set Connection Failed.. Object reference not set to an instance of an object" error?

    Hi,

    I've managed to successfully integrate with the cute chat application (v1) and have it working on a development machine. Today I have put the same app on another set of machines: one IIS 6 box and one SQL 2000 box. The code has been copied across and everything works except for the chat window. On the homepage of the application it goes and reads the available chat rooms, and this works - this tells me that the install of CuteChat within the application itself is working insofar as I can get a list of chatrooms etc. and the database connections are working. However, when I try to launch the chat client itself, I get this error:

    --------------------
    Connection Failed.. Object reference not set to an instance of an object.retry
    server side CuteChat.ConnectFailedException: CuteChat.ConnectFailedException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. Server stack trace: at Taecanet.Web.UI.Chat.ChatSqlDataProvider.ListUserUniqueName() Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at CuteChat.SqlServer.ISqlDataProvider.ListUserUniqueName() at CuteChat.SqlServer.SqlDataAccess.GetUserInternalId(String uniquename) Exception rethrown at [1]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at CuteChat.IDataAccess.GetUserInternalId(String uniquename) at CuteChat.ChatSystem.GetUserIdentity(String useruniquename) Exception rethrown at [2]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at CuteChat.ChatSystem.GetUserIdentity(String useruniquename) at CuteChat.ChatRaneService.get_CurrentUser() at CuteChat.ChatRaneService.Connect() --- End of inner exception stack trace --- at CuteChat.ChatRaneService.Connect()

    ----------------

    This implies that there is a problem with my implementation of the ListUserUniqueName method; here's the code:



            public override string [] ListUserUniqueName ()
            {
                _Dataset.ListUserUniqueName ();
                int nCount = 0;
                string [] UserList = new string [_Dataset.User.Rows.Count];
               
                foreach (Taecanet.Web.Data.Datasets.Chat.UserRow ur in _Dataset.User)
                {
                    UserList[nCount] = ur.ID;
                    nCount ++;
                }

                return UserList;
            }

    _Dataset is a class which inherits from a strongly typed database and adds methods, such as the ListUniqueUserName method. This goes off to the database and does a select * from the database's user table (my database, not the cutechat one).

    This code works absolutely fine on my local machine and on four other boxes. Why would I be getting the above error - I would guess it must be something in the configuration file, but then surely I wouldn't even be able to get a list of available rooms, which I can do on the home page?

    Many thanks

    Eyesy


View Complete Thread