A content author can submit changes in the Rich Text Editor (RTE) field several times in a short period of time. Such actions might lead to one or more of the following symptoms.
[NullReferenceException: Object reference not set to an instance of an object.] System.Collections.Specialized.NameObjectCollectionBase.BaseRemove(String name) +130 System.Web.SessionState.SessionStateItemCollection.Remove(String name) +96 Sitecore.Web.WebUtil.RemoveSessionValue(String key) +109 Sitecore.Shell.Controls.RADEditor.Preview.GetText() +54 Sitecore.Shell.Controls.RADEditor.Preview.OnLoad(EventArgs e) +80 System.Web.UI.Control.LoadRecursive() +153 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4087
ERROR Unhandled exception detected. The ASP.NET worker process will be terminated. Exception: System.NullReferenceException Message: Object reference not set to an instance of an object. Source: System.Web at System.Web.SessionState.SessionStateItemCollection.get_Item(Int32 index) at System.Web.Util.AspCompatApplicationStep.AnyStaObjectsInSessionState(HttpSessionState session) at System.Web.HttpApplicationFactory.FireSessionOnEnd(HttpSessionState session, Object eventSource, EventArgs eventArgs) at System.Web.SessionState.SessionOnEndTargetWorkItem.RaiseOnEndCallback() at System.Web.Util.WorkItem.CallCallbackWithAssert(WorkItemCallback callback) at System.Web.Util.WorkItem.OnQueueUserWorkItemCompletion(Object state)
Technical details:
The issue occurs if the SessionStateBehavior is set to ReadOnly. Such behavior enables parallel processing of requests triggered by the same user. ReadOnly SessionStateBehavior does not prevent changes to a user's session. If two requests make concurrent changes to the same session then the session collection (not thread-safe by design) might become corrupted.
To resolve the issue, ensure that the ReadOnly SessionStateBehavior is not used. This can be done by considering one of the following options:
<?xml version="1.0" encoding="utf-8" ?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/"> <sitecore> <settings> <setting name="ContentTesting.AutomaticContentTesting.Enabled" set:value="false" /> </settings> </sitecore> </configuration>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/"> <sitecore>Note: Deleting this processor does not affect the application performance or functionality.
<pipelines> <httpRequestBegin> <processor type="Sitecore.ContentTesting.Pipelines.HttpRequest.SetReadOnlySessionStateForScreenshot, Sitecore.ContentTesting"> <patch:delete /> </processor> </httpRequestBegin> </pipelines> </sitecore> </configuration>