Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsUsers OnlineUsers OnlineObject reference not set to an instance of an object - TrackAuthenticatedUserObject reference not set to an instance of an object - TrackAuthenticatedUser
Previous
 
Next
New Post
1/6/2006 8:29 PM
 

I'm seeing the following exception quite often.  It happens on all my pages, not just the page the module is on.

System: DNN 4.00.2, UsersOnline 3.01.00

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.]
   DotNetNuke.Entities.Users.UserOnlineController.TrackAuthenticatedUser(HttpContext context) +196
   DotNetNuke.Entities.Users.UserOnlineController.TrackUsers() +95
   DotNetNuke.HttpModules.UsersOnlineModule.OnAuthorizeRequest(Object s, EventArgs e) +131
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
 
New Post
1/14/2006 10:12 PM
 

Finally got my debug environment up.  This is happening in UserOnlineController.vb line 125.  In this case the code is checking if a member of the userList is null, but the userList itself is null (and never checked).

If (userList(objUserInfo.UserID.ToString()) Is Nothing) Then

The only solution for this that I see is a check for userList Is Nothing after its created, and if so, return.  I'm quite sure how it would get in this state unless the DataCache expired?!?!?

System.NullReferenceException was unhandled by user code
  Message="Object reference not set to an instance of an object."
  Source="DotNetNuke"
  StackTrace:
       at DotNetNuke.Entities.Users.UserOnlineController.TrackAuthenticatedUser(HttpContext context) in C:\Downloads\DotNetNuke_4.0.2_Source\Library\Components\Users\UserOnlineController.vb:line 125
       at DotNetNuke.Entities.Users.UserOnlineController.TrackUsers() in C:\Downloads\DotNetNuke_4.0.2_Source\Library\Components\Users\UserOnlineController.vb:line 81
       at DotNetNuke.HttpModules.UsersOnlineModule.OnAuthorizeRequest(Object s, EventArgs e) in C:\Downloads\DotNetNuke_4.0.2_Source\Library\HttpModules\UsersOnline\UsersOnlineModule.vb:line 64
       at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

 
New Post
1/22/2006 3:55 AM
 
 
New Post
1/25/2006 9:07 AM
 

James, it appears in the above thread that offered solution is to find the following 8 files:

Domain.vb
Configuration.vb
XMLLoggingProvider.vb
RewriterConfiguration.vb
ClientAPI.vb
UserOnlineController.vb
Localization.vb
SiteLogController.vb

and find the pattern:

If (DataCache.GetCache("object") Is Nothing)
   Dim obj = (... code for loading config from files ...)
   DataCache.SetCache("object", obj)
End If
Return DataCache.GetCache("object")

and replace it with this pattern:

Dim obj = DataCache.GetCache("object")
If obj Is Nothing
   obj = (... code for loading config from files ...)
   DataCache.SetCache("object", obj)
End If
Return obj

Is that right? And if so, for those of us who are users and not developers, will there be a new release with a fix for this bug soon?

Thanks,

Chris

 
New Post
1/26/2006 12:11 AM
 

I'm actually just an end user myself that happens to code... 

I entered the bug into the bug tracker, but I don't know the schedule for fixing these issue.  Before I get my development environment up and running I had to disable that functionality.  Another work around may be to set the Host Site settings performance settings to Heavy Caching.  I didn't test that but noted that caused a different code path to be followed in the cache code itself.

If you have a development environment, here is the code I changed:

Public Function GetUserList() As Hashtable
   
Dim key As String = "OnlineUserList"
   
Dim userList As Hashtable = CType(DataCache.GetCache(key), Hashtable)
   
' Do we have the Hashtable?
   
'
   
If (userList Is Nothing) Then
      
userList = New Hashtable
      DataCache.SetCache(key, userList)
   
End If
   
Return userList
End Function

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsUsers OnlineUsers OnlineObject reference not set to an instance of an object - TrackAuthenticatedUserObject reference not set to an instance of an object - TrackAuthenticatedUser


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out