Page 1 of 1
Session State in Back Office
Posted: Thu Aug 14, 2008 10:21 am
by trozzi
We are testing for a client that will be deploying in a web farm. We configured Sql Session State to manage the web site. Everything test fine on the site. We navigated to the following page in he back office
/Admin/Products/Reviews/Default.aspx
We raised the following error
Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.
Thanks
Thomas
Re: Session State in Back Office
Posted: Fri Aug 15, 2008 12:46 pm
by sohaib
We configured Sql Session State to manage the web site.
Not sure what this means. Can you please explain?
Re: Session State in Back Office
Posted: Fri Aug 15, 2008 1:29 pm
by mazhar
Please give a try to this solution. Edit the
App_Code/SearchCriteriaCache.cs file
and locate the following class
Code: Select all
public class SearchCriteria
{
public Dictionary<string, object> Arguments;
public int PageIndex;
public string SortExpression;
public SortDirection SortDirection;
public SearchCriteria()
{
Arguments = new Dictionary<string, object>();
PageIndex = 0;
SortExpression = string.Empty;
SortDirection = SortDirection.Ascending;
}
}
and mark this class as serializeable by putting an attribute upon it as below
Code: Select all
[Serializable]
public class SearchCriteria
{
public Dictionary<string, object> Arguments;
public int PageIndex;
public string SortExpression;
public SortDirection SortDirection;
public SearchCriteria()
{
Arguments = new Dictionary<string, object>();
PageIndex = 0;
SortExpression = string.Empty;
SortDirection = SortDirection.Ascending;
}
}
Re: Session State in Back Office
Posted: Fri Aug 15, 2008 4:22 pm
by trozzi
Thanks AbleCommerce Developers
Thomas
Re: Session State in Back Office
Posted: Tue Aug 19, 2008 11:39 am
by trozzi
Found a new page that has the same error message.
It appears to be from the line of code.
OrderSearchCriteria criteria = Session["OrderSearchCriteria"] as OrderSearchCriteria;
I think this object needs tagged as Serializable, but it is contained in one of Able Commerce's assemblies.
/Admin/Orders/Default.aspx
Thanks
Thomas
Re: Session State in Back Office
Posted: Tue Aug 19, 2008 11:50 am
by sohaib
This time the solution is not simple.
The object that needs to be Serializable in this case is in the compiled DLL.
It is CommerceBuilder.Reporting.OrderSearchCriteria.
A DLL update would be needed to get this fixed.
I have escalated this case in our bug tracking system. We will see if a patch could be provided for this.
Re: Session State in Back Office
Posted: Tue Aug 19, 2008 1:09 pm
by trozzi
Another Page
/Admin/Website/Scriptlets/ConLibHelp2.aspx
I greped the admin area for "Session[" and I found these others that look like they may be in the same category...
ConLibHelp.aspx.cs
ConLibHelp2.aspx.cs
ConLibHelpAll.aspx.cs
Thanks
Thomas
Re: Session State in Back Office
Posted: Tue Aug 19, 2008 1:14 pm
by sohaib
Yes we have identified the above as well as ConLib/SimilarProducts.ascx.cs as potential candidates for such errors.
Re: Session State in Back Office
Posted: Thu Jun 11, 2009 10:26 am
by mfreeze
I have a client that just upgraded to 7.03 and is still getting this message. According to bug 7075, this should have been fixed in 7.0. I have pasted the exact error we are getting below. The error occurs when attempting to access the Manage/Users screen.
Server Error in '/' Application.
________________________________________
Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.
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.Web.HttpException: Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.
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:
[SerializationException: Type 'CommerceBuilder.Users.UserSearchCriteria' in Assembly 'CommerceBuilder, Version=7.3.12065.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.]
System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) +2700482
System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) +245
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() +88
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +175
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +50
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +438
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) +131
System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer) +1513
[HttpException (0x80004005): Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.]
System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer) +1602
System.Web.SessionState.SessionStateItemCollection.WriteValueToStreamWithAssert(Object value, BinaryWriter writer) +34
System.Web.SessionState.SessionStateItemCollection.Serialize(BinaryWriter writer) +627
System.Web.SessionState.SessionStateUtility.Serialize(SessionStateStoreData item, Stream stream) +257
System.Web.SessionState.SessionStateUtility.SerializeStoreData(SessionStateStoreData item, Int32 initialStreamSize, Byte[]& buf, Int32& length) +60
System.Web.SessionState.SqlSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +114
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +476
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
Re: Session State in Back Office
Posted: Wed Jun 17, 2009 11:14 am
by mfreeze
Can someone at Able take a look at this error, please?
Re: Session State in Back Office
Posted: Wed Jun 17, 2009 11:48 am
by Logan Rhodehamel
Bug 8148.. same error message, different code problem.
http://help.ablecommerce.com/upgrades/a ... _7.0.3.htm
It should be corrected by the latest CommerceBuilder.DLL. Please let me know if not.