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  |  

AspDotNetStoreFront
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  HTML / Text Mo...  error
Previous Previous
 
Next Next
New Post 2/27/2008 10:47 PM
User is offline Sebastian Leupold
13210 posts
www.deutschnetnuke.de
1st Ranked












Re: Problem still there 

Did you already check with DNN 4.8.1, we have fixed a large number of issues.


Sebastian Leupold

DeutschNetNuke dnnWerk - The DotNetNuke Experts German DotNetNuke User-Group

DotNetNuke Project UserDefinedTable
DotNetNuke Project Release Tracker
 
New Post 3/1/2008 1:02 PM
User is offline Roger Selwyn
772 posts
www.thedivingclub.co.uk
7th Ranked




Re: Problem still there 

Hi Sebastian,

I'm still getting this one on 4.8.1. Problem is, it appears random.I can't see what the common theme is. It occurs on multiple pages. But I tend to get several of these in the log at the same time. I happened to be on the site when it happened yesterday, and all my menus had disappeared. I have already done the SupportedFeatures check (0/-1) - that does solve some of this type of error, but not all.

Cheers
Roger

AssemblyVersion: 04.08.01
PortalID: 0
PortalName: The Diving Club - Reading
UserID: -1
UserName:
ActiveTabID: 58
ActiveTabName: Newsletters
RawURL: /Newsletters/tabid/58/articleType/ArchiveView/month/4/year/2007/Default.aspx
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer: http://www.thedivingclub.co.uk/Newsletters/tabid/58/Default.aspx
UserAgent: Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: caaa1548-0ebf-4af9-8210-d3c0b7900f45
InnerException: Unhandled Error:
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Collections.Generic.Dictionary`2.Insert
StackTrace:
Message: System.Exception: Unhandled Error: ---> System.NullReferenceException: Object reference not set to an instance of an object. at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at DotNetNuke.Entities.Modules.ModuleController.GetModuleByDefinition(Int32 PortalId, String FriendlyName) at DotNetNuke.Entities.Portals.PortalSettings.GetSiteSetting(Int32 PortalId, String SettingName) at DotNetNuke.HttpModules.UrlRewriteModule.OnBeginRequest(Object s, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --- End of inner exception stack trace ---
Source:
Server Name: GENERIC31


Events 4.0.1 - It's released !! - See the announcement
 
New Post 4/10/2008 6:17 AM
User is offline Dennis Lacey
6 posts
10th Ranked


Anyone fine a fix for the System.Collections.Generic.Dictionary'2.Insert Exception? 

Hi,

I get a LOT of these and they are causing problems with my site.  I've looked for the 0 / -1 in supported features and didn't have any.  Any suggestions are greatly appreciated.  Thanks!

AssemblyVersion: 04.08.02
PortalID: 0
PortalName: StarPower Talent Competition
UserID: -1
UserName:
ActiveTabID: 538
ActiveTabName: Portal Entry
RawURL: /Default.aspx
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer:
UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 3a7e2e24-253d-4929-9172-89b80f1b14a0
InnerException: Unhandled Error:
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Collections.Generic.Dictionary`2.Insert
StackTrace:
Message: System.Exception: Unhandled Error: ---> System.NullReferenceException: Object reference not set to an instance of an object. at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at DotNetNuke.Entities.Modules.ModuleController.GetModuleByDefinition(Int32 PortalId, String FriendlyName) at DotNetNuke.Entities.Portals.PortalSettings.GetSiteSetting(Int32 PortalId, String SettingName) at DotNetNuke.HttpModules.UrlRewriteModule.OnBeginRequest(Object s, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --- End of inner exception stack trace ---
Source:
Server Name: GENERIC21

 
New Post 4/10/2008 5:47 PM
User is offline Charles Nurse
2655 posts
5th Ranked










Re: Anyone fine a fix for the System.Collections.Generic.Dictionary'2.Insert Exception? 

I have the answer - but not the solution.

If we look at the code in GetModuleByDefinition - we need to focus on where something is inserted into a dictionary - the error is caused by an attempt to call a method on a object that is null.

  955         Public Function GetModuleByDefinition(ByVal PortalId As Integer, ByVal FriendlyName As String) As ModuleInfo

  956 

  957             ' format cache key

  958             Dim key As String = String.format(DataCache.ModuleCacheKey, PortalId)

  959 

  960             ' get module dictionary from cache

  961             Dim modules As Dictionary(Of String, ModuleInfo) = TryCast(DataCache.GetPersistentCacheItem(key, GetType(Dictionary(Of String, ModuleInfo))), Dictionary(Of String, ModuleInfo))

  962 

  963             If modules Is Nothing Then

  964                 ' set module caching settings

  965                 Dim timeOut As Int32 = DataCache.ModuleCacheTimeOut * Convert.ToInt32(Common.Globals.PerformanceSetting)

  966 

  967                 ' create new dictionary

  968                 modules = New Dictionary(Of String, ModuleInfo)

  969 

  970                 ' cache module dictionary

  971                 If timeOut > 0 Then

  972                     DataCache.SetCache(key, modules, TimeSpan.FromMinutes(timeOut), True)

  973                 End If

  974             End If

  975 

  976             ' declare return object

  977             Dim objModule As ModuleInfo = Nothing

  978 

  979             ' get specific module object from cache based on FriendlyName

  980             If modules.ContainsKey(FriendlyName) Then

  981                 objModule = modules(FriendlyName)

  982             End If

  983 

  984             ' if module is not in cache

  985             If objModule Is Nothing Then

  986                 ' get from database

  987                 Dim dr As IDataReader = DataProvider.Instance().GetModuleByDefinition(PortalId, FriendlyName)

  988                 Try

  989                     ' hydrate object

  990                     objModule = FillModuleInfo(dr)

  991                 Finally

  992                     ' close connection

  993                     If Not dr Is Nothing Then

  994                         dr.Close()

  995                     End If

  996                 End Try

  997                 ' add object to module cache dictionary

  998                 modules(FriendlyName) = objModule

  999             End If

 1000 

 1001             ' return module object

 1002             Return objModule

 1003         End Function

 

In line 998 an attempt is made to add objModule to modules.  This is the only line of code in this method where the method is Dictionary'.Insert (the compiler converts the statement "module(FriendlyName) = objModule" to "modules.Insert(FriendlyName, objModule)".

If we look at the code an attempt is made to retrieve the Dictionary from the cache (line 961).  If it is null a new one is created and added to the cache (lines 963 - 974) then an attempt is made to find the module in the Dictionary, and if it is not there add it (line 998).  You would think at first glance that there is guarnateed to be  Dictionary so why the null refernec exception.

However, we need to understand how the cache works. 

  • In line 961 we get a reference to a cached object.
  • In line 963 we check if it is nothing - lets assume it isn't
  • In line 998 we now attempt to reference it - but what if the cache has expired the object in the meantime - the reference will now be null.

So the issue happens in a memory intensive site - where the cache expires between line 963 and line 998 as ASP.NET determines it needs more memory.


Charles Nurse
DotNetNuke Trustee
DNN Developer Zone
 
New Post 4/11/2008 8:08 AM
User is offline Craig Carns
62 posts
www.ctc.com
10th Ranked




Re: Anyone fine a fix for the System.Collections.Generic.Dictionary'2.Insert Exception? 

Charles,

   Hopefully you are on to something and thanks for telling me about the updates in Benefactor form. Now down to business...

On my server I would say it is a low hit site - it on the Intranet with a user base of about 1000. It takes a few days for my server to go down and it is a beefy box with 4gb of RAM.

If it has to do with Cache should I be changing my Cache settings to hopefully fix it? Currently my site is set to Moderate Cacheing but I am changing it to No Cache. Do you think this will fix it for now (realizing my site is going to make more db calls).

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  HTML / Text Mo...  error
 


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.

 


ZLDNN.COM
We provide commercial DotNetNuke modules.
www.zldnn.com
DNNhost Scandinavia
SUPER fast QuadCore DELL servers, MSSQL servers, DotNetPanel, daily backup, Check out our customers websites
DNNhost.dk
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

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