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  |  

Affordable ASP.NET Hosting Service
  Ads  
 


  Sponsors  

Meet Our Sponsors

The best choice for your web site host, email hosting, and domain registration.
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
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Forum Module [L...  A critical error has occurred. Value cannot be null. Parameter name: value
Previous Previous
 
Next Next
New Post 1/8/2008 10:44 PM
Unresolved
User is offline Jamo kay
31 posts
10th Ranked


A critical error has occurred. Value cannot be null. Parameter name: value 
Modified By Jamo kay  on 1/9/2008 6:23:43 AM)

 

Hello good people of Dotnetnuke, am having the below problem in my forum and have no ideas what's causing it.  This is happening only on one thread and am thinking it's something to do the last post a member posted.

Any help would be much appreciated.

Thanks.  

AssemblyVersion: 04.08.00
PortalID: 0
PortalName:
UserID: -1
UserName:
ActiveTabID: 54
ActiveTabName: Forum
RawURL: /Forum/tabid/54/forumid/6/scope/threads/language/en-GB/Default.aspx
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer: http://www.najivunia.co.uk/Forum/tabid/54/forumid/6/scope/threads/Default.aspx
UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; Media Center PC 5.0; InfoPath.2)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 395be457-f124-42ed-b547-08d0fc4ba42b
InnerException: Value cannot be null. Parameter name: value
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Web.Caching.CacheEntry..ctor
StackTrace:
Message: System.ArgumentNullException: Value cannot be null. Parameter name: value at System.Web.Caching.CacheEntry..ctor(String key, Object value, CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, Boolean isPublic) at System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic, String key, Object value, CacheDependency dependencies, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, Boolean replace) at System.Web.Caching.Cache.Insert(String key, Object value, CacheDependency dependencies) at DotNetNuke.Services.Cache.FileBasedCachingProvider.FBCachingProvider.Insert(String CacheKey, Object objObject, Boolean PersistAppRestart) at DotNetNuke.Common.Utilities.DataCache.SetCache(String CacheKey, Object objObject) at DotNetNuke.Modules.Forum.ThreadInfo.GetThreadInfo(Int32 ThreadID) at DotNetNuke.Modules.Forum.Threads.RenderThreadInfo(HtmlTextWriter wr, Boolean AggregatedView)
Source:
Server Name: WEBSERVER

 
New Post 1/9/2008 1:01 AM
User is offline Jamo kay
31 posts
10th Ranked


Re: A critical error has occurred. Value cannot be null. Parameter name: value 

Please look at this I've tried a few things to no avail, hope someone can help.

Thanks again.

 
New Post 1/10/2008 4:55 AM
User is offline Jamo kay
31 posts
10th Ranked


Re: A critical error has occurred. Value cannot be null. Parameter name: value 

OK, no replies yet so... How do you go about the solution below...

Thanks...

The Exception logs on dnn.com show a number of errors from trying to cache a null object - for example

Message: System.Exception: Unhandled Error: ---> System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ArgumentNullException: Value cannot be null. Parameter name: value at System.Web.Caching.CacheEntry..ctor(String key, Object value, CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, Boolean isPublic) at System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic, String key, Object value, CacheDependency dependencies, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, Boolean replace) at System.Web.Caching.Cache.Insert(String key, Object value, CacheDependency dependencies) at DotNetNuke.Services.Cache.FileBasedCachingProvider.FBCachingProvider.Insert(String CacheKey, Object objObject, Boolean PersistAppRestart) at DotNetNuke.Common.Utilities.DataCache.SetCache(String CacheKey, Object objObject) at DotNetNuke.Modules.Forum.ForumInfo.GetForumInfo(Int32 ForumID)

and

Message: DotNetNuke.Services.Exceptions.PageLoadException: Value cannot be null. Parameter name: value ---> System.ArgumentNullException: Value cannot be null. Parameter name: value at System.Web.Caching.CacheEntry..ctor(String key, Object value, CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, Boolean isPublic) at System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic, String key, Object value, CacheDependency dependencies, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, Boolean replace) at System.Web.Caching.Cache.Insert(String key, Object value, CacheDependency dependencies) at DotNetNuke.Services.Cache.FileBasedCachingProvider.FBCachingProvider.Insert(String CacheKey, Object objObject, Boolean PersistAppRestart) at DotNetNuke.Common.Utilities.DataCache.SetCache(String CacheKey, Object objObject) at DotNetNuke.Modules.Forum.ThreadInfo.GetThreadInfo(Int32 ThreadID)

The
GetThreadInfo code looks like this:

        Public Shared Function GetThreadInfo(ByVal ThreadID As Integer) As ThreadInfo
            Dim strCacheKey As String = ThreadInfoCacheKeyPrefix & CStr(ThreadID)
            Dim objThread As ThreadInfo = CType(DataCache.GetCache(strCacheKey), ThreadInfo)

            If objThread Is Nothing Then
                Dim ctlThread As New ThreadController
                objThread = ctlThread.ThreadGet(ThreadID)
                DataCache.SetCache(strCacheKey, objThread)
            End If

            Return objThread
        End Function

and the GetForumInfo code is very similar.

There are two problems with this code:

  1. There is no check the object returned is not null before attempting to save it to the cache.
  2. The code does not respect the Host users selection for cache performance.

Thus GetThreadInfo should be changed to:

        Public Shared Function GetThreadInfo(ByVal ThreadID As Integer) As ThreadInfo
            Dim strCacheKey As String = ThreadInfoCacheKeyPrefix & CStr(ThreadID)
            Dim objThread As ThreadInfo = CType(DataCache.GetCache(strCacheKey), ThreadInfo)

            If objThread Is Nothing Then
                'thread caching settings
                Dim timeOut As Int32 = ThreadInfoCacheTimeout * Convert.ToInt32(Common.Globals.PerformanceSetting)

                Dim ctlThread As New ThreadController
                objThread = ctlThread.ThreadGet(ThreadID)

                'Cache Thread if tmeout > 0 and Thread is not null
                If timeOut > 0 And objThread IsNot Nothing Then
                    DataCache.SetCache(strCacheKey, objThread, TimeSpan.FromMinutes(timeOut), False)
                End If
            End If

            Return objThread
        End Function

Note: PostInfo has the 2nd issue (performance setting) but does not have the first issue.

 
New Post 1/10/2008 9:34 AM
User is offline Jamo kay
31 posts
10th Ranked


Re: A critical error has occurred. Value cannot be null. Parameter name: value 

Ok, seems like I have to get used to answering myself in here.  Here we go, after going through loads of threads, I came accross the actual problem and managed to solve the issue for the time being, which means it can happen again soon.

The error occurs when a user session expires while still writing a post, upon submiting the post, the forum changes the UserID to 0 and problem appears from then on.

I managed to change the UserID on that post to the actual users ID using Visual Studio solution explorer et voila!

I still need to sort this problem once and for all though! Maybe the solution I posted above will be able to sort this out?!?!   I Just don't know how to go about doing it.

 
New Post 1/24/2008 10:20 AM
User is offline BillQ
20 posts
10th Ranked


Re: A critical error has occurred. Value cannot be null. Parameter name: value 

Hi DNN Team,

These errors:

InnerException: Value cannot be null. Parameter name: value

and

InnerException: Unhandled Error:

make the dotnetnuke forums unreliable and unusable.

I have now spent hours deleting posts to address these errors and to get my forums up and running again.

What is the resolution for these errors?


Thanks, Bill
 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Forum Module [L...  A critical error has occurred. Value cannot be null. Parameter name: value
 


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