コンテンツの作成者が、リッチ テキスト エディター(RTE)フィールドに対して、短時間に何度も変更を加えることがあります。このような操作によって、次の事象が発生する可能性があります:
[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)
技術詳細:
この問題は、SessionStateBehaviorがReadOnlyに設定された場合に発生します。この設定の値がReadOnlyに設定されると、同じユーザーからのリクエストを並行して処理することが可能になりますが、ユーザーのセッションへの変更は防止されません。そのため、2つのリクエストが同じセッションを同時に変更すると、(設計上、スレッドセーフではないため)セッション コレクションが破損する可能性があります。
この問題を解決するには、SessionStateBehaviorでReadOnly設定が使用されていないことを確認してください。これを実施するには、以下のいずれかの方法を検討してください:
<?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>註:このプロセッサを削除しても、アプリケーションのパフォーマンスや機能への影響はありません。
<pipelines> <httpRequestBegin> <processor type="Sitecore.ContentTesting.Pipelines.HttpRequest.SetReadOnlySessionStateForScreenshot, Sitecore.ContentTesting"> <patch:delete /> </processor> </httpRequestBegin> </pipelines> </sitecore> </configuration>