We are having occuring application pool crashes with folowing exception.
Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException Stack: at System.Collections.Specialized.NameObjectCollectionBase.BaseGet(Int32) at System.Web.SessionState.SessionStateItemCollection.get_Item(Int32)
at System.Web.SessionState.HttpSessionStateContainer.get_Item(Int32) at System.Web.Util.AspCompatApplicationStep.AnyStaObjectsInSessionState(System.Web.SessionState.HttpSessionState) at System.Web.HttpApplicationFactory.FireSessionOnEnd(System.Web.SessionState.HttpSessionState,
System.Object, System.EventArgs) at System.Web.SessionState.SessionOnEndTargetWorkItem.RaiseOnEndCallback() at System.Web.Util.WorkItem.CallCallbackWithAssert(System.Web.Util.WorkItemCallback) at System.Web.Util.WorkItem.OnQueueUserWorkItemCompletion(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
I have read the KB http://support.microsoft.com/kb/827164 that it can occur when you are storing STA objects in the session, but I don´t think we do. How can we solve this issue? Just setting apartmentThreading to true doesn´t feel right.
I have tested setting apartmentThreading to true but that didn't help. I havn't been able to get a crash dump yet. For some reason my initial try didn't caught the exception.
tobias
Member
5 Points
10 Posts
Session exception terminates application pool
Jan 09, 2013 06:00 PM|LINK
We are having occuring application pool crashes with folowing exception.
Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException Stack: at System.Collections.Specialized.NameObjectCollectionBase.BaseGet(Int32) at System.Web.SessionState.SessionStateItemCollection.get_Item(Int32) at System.Web.SessionState.HttpSessionStateContainer.get_Item(Int32) at System.Web.Util.AspCompatApplicationStep.AnyStaObjectsInSessionState(System.Web.SessionState.HttpSessionState) at System.Web.HttpApplicationFactory.FireSessionOnEnd(System.Web.SessionState.HttpSessionState, System.Object, System.EventArgs) at System.Web.SessionState.SessionOnEndTargetWorkItem.RaiseOnEndCallback() at System.Web.Util.WorkItem.CallCallbackWithAssert(System.Web.Util.WorkItemCallback) at System.Web.Util.WorkItem.OnQueueUserWorkItemCompletion(System.Object) at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
I have read the KB http://support.microsoft.com/kb/827164 that it can occur when you are storing STA objects in the session, but I don´t think we do. How can we solve this issue? Just setting apartmentThreading to true doesn´t feel right.
secher
Member
114 Points
22 Posts
Re: Session exception terminates application pool
Jan 11, 2013 06:44 AM|LINK
Why do you to store this objects in Session and not in Cache. I'm not sure, but may be for Session storage it must be serializable.
Angie xu - M...
All-Star
18664 Points
1590 Posts
Microsoft
Re: Session exception terminates application pool
Jan 14, 2013 06:00 AM|LINK
Hi tobias
You could understand and diagnose an application pool crash first, and then learn how to best deal with it below,
application pool crash
application domains, application pools and unhandled exceptions
hope it helps you,
Kind regards
Feedback to us
Develop and promote your apps in Windows Store
tobias
Member
5 Points
10 Posts
Re: Session exception terminates application pool
Jan 16, 2013 07:06 AM|LINK
I have tested setting apartmentThreading to true but that didn't help. I havn't been able to get a crash dump yet. For some reason my initial try didn't caught the exception.
sameer_khanj...
Contributor
7066 Points
1381 Posts
Re: Session exception terminates application pool
Jan 16, 2013 07:33 AM|LINK
Please check below thread :-
http://stackoverflow.com/questions/4742122/asp-net-application-pool-shutdown-problem
sameer.khanjit@gmail.com
View Blog
Click "Mark as Answer" on the post that helped you.
tobias
Member
5 Points
10 Posts
Re: Session exception terminates application pool
Jan 16, 2013 07:55 AM|LINK
I have enabled legacyUnhandledExceptionPolicy so the application pool won't crash but that doesn't solve the underlying problem.
sameer_khanj...
Contributor
7066 Points
1381 Posts
Re: Session exception terminates application pool
Jan 16, 2013 08:02 AM|LINK
Please give me answers for following questions :-
1) Are you using webfarm ?
2)Are you using App fabric ?
3) what are you storing in session ? any complex object ?
4) Are you storing viewstate in session ?
5) session stored in inmemory or using state server\SQl server ?
sameer.khanjit@gmail.com
View Blog
Click "Mark as Answer" on the post that helped you.
sameer_khanj...
Contributor
7066 Points
1381 Posts
Re: Session exception terminates application pool
Jan 16, 2013 08:02 AM|LINK
Please give me answers for following questions :-
1) Are you using webfarm ?
2)Are you using App fabric ?
3) what are you storing in session ? any complex object ?
4) Are you storing viewstate in session ?
5) session stored in inmemory or using state server\SQl server ?
sameer.khanjit@gmail.com
View Blog
Click "Mark as Answer" on the post that helped you.
tobias
Member
5 Points
10 Posts
Re: Session exception terminates application pool
Jan 16, 2013 08:42 AM|LINK
1) We are using a load balancer but each request for an application is always served by same webserver.
2) No.
3) Mostly primitives but som more complex objects.
4) No.
sameer_khanj...
Contributor
7066 Points
1381 Posts
Re: Session exception terminates application pool
Jan 16, 2013 08:45 AM|LINK
Please provide machine key in each webconfig.
Please make sure machinekey should be same on all server. will solve your error.
http://msdn.microsoft.com/en-us/library/ff649308.aspx
Also check use full post :
http://www.c-sharpcorner.com/UploadFile/gopenath/Page107182007032219AM/Page1.aspx
sameer.khanjit@gmail.com
View Blog
Click "Mark as Answer" on the post that helped you.