Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

DotNetNuke Marketplace
  Ads  
 


  Sponsors  

Meet Our Sponsors

CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
SteadyRain
DataSprings - Great Ideas. Always Flowing.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Users Online Mo...  Object reference not set to an instance of an object - TrackAuthenticatedUser
Previous Previous
 
Next Next
New Post 1/6/2006 5:29 PM
User is offline James Webster
63 posts
www.mhs87.com
10th Ranked


Object reference not set to an instance of an object - TrackAuthenticatedUser 

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 7:12 PM
User is offline James Webster
63 posts
www.mhs87.com
10th Ranked


Re: Object reference not set to an instance of an object - TrackAuthenticatedUser 

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 12:55 AM
User is offline James Webster
63 posts
www.mhs87.com
10th Ranked


Re: Object reference not set to an instance of an object - TrackAuthenticatedUser 
Solution is on this thread: http://www.dotnetnuke.com/Community/ForumsDotNetNuke/tabid/795/forumid/108/threadid/14097/scope/posts/Default.aspx
 
New Post 1/25/2006 6:07 AM
User is offline chris grimes
6 posts
10th Ranked


Re: Object reference not set to an instance of an object - TrackAuthenticatedUser 

 james3838 wrote
Solution is on this thread: http://www.dotnetnuke.com/Community/ForumsDotNetNuke/tabid/795/forumid/108/threadid/14097/scope/posts/Default.aspx

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/25/2006 9:11 PM
User is offline James Webster
63 posts
www.mhs87.com
10th Ranked


Re: Object reference not set to an instance of an object - TrackAuthenticatedUser 

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 Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Users Online Mo...  Object reference not set to an instance of an object - TrackAuthenticatedUser
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Personify Design, Inc.
Seattle-based Personify Design has developed customized DotNetNuke websites for a wide range of customers to meet many different types of needs, including distributed authorship across thousands of pages to integrated Verisign e-commerce capabilities.
www.personifydesign.com
DNN Outsourcing
50% more affordable services comparing to Western Europe and US: Custom DotNetNuke module development, skins, consulting, maintainence... Over 15.000 working hours of experience in custom DotNetNuke Solutions development, 8 years experience in outsourcing, excellent references!
www.dnnoutsourcing.com
Expressnet - DotNetNuke Hosting
Expressnet provide premium quality ASP.NET Web Hosting. We specialise in Windows based products including ASP.NET and Microsoft SQL Server. We offer fantastic value packages for DotNetNuke hosting. We also offer free asp.net web hosting
www.expressnet.com.au

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP