如何修复SDL Tridion SiteEdit 2009 SP2/3的代理错误



当我第一次访问SiteEdit的代理网站时,一切都加载正确,我可以启用SiteEdit并进行良好的交互。然而,如果我点击页面上的任何链接,进行简单的F5刷新或直接键入代理网站的其他URL,我会收到一个错误。在错误页面上,我仍然看到"SiteEdit"按钮以启用SiteEdit模式,但在它后面(本质上是代理页面显示的框架),我有一个简单的"An error has occured in the proxy"消息。

在内容管理器服务器上,我可以查看应用程序事件日志,看到SiteEdit报告的错误是"读取传入请求时出错。对象引用未设置为对象实例。">

如果我关闭浏览器,然后加载我试图访问的页面,一切都会很好。但是,如果我刷新或尝试转到任何其他页面(链接或直接),我会再次出现错误。关闭浏览器并重复。。。

有人能说明这件事吗?我目前正在将SiteEdit 2009 SP2升级到SP3,这是我们的生产(SP2)和我的沙箱(SP3)环境中存在的问题。当然,我们的内容编辑器不使用SiteEdit(很大程度上是因为这个原因),我希望SP3升级可能已经解决了它的核心问题(但显然没有)。

我认为我已经正确配置了IE9(我在我的Intranet区域中有网站,我设置了适当的脚本权限,我允许弹出窗口,等等),因为它适用于初始呈现,但在同一浏览器会话中转到另一个页面的任何尝试都失败了。

感谢您的真知灼见。

自从我联系支持人员以来已经有几周了,但在过去的几周里&对于配置和设置,他们最终要求我提供对象引用错误的堆栈跟踪。

这让我与我的一位同事(他最近一直在研究Tridion的日志记录)合作,调整日志记录配置,以查看堆栈跟踪输出。不幸的是,在向支持部门报告了这个问题后,我重置了我正在处理的环境(因为我也一直在升级到Tridion 2011),当他们提出这个请求时,SiteEdit没有按照配置的方式登录应用程序事件日志(我认为这可能是权限问题)。

为了获得堆栈跟踪,我的同事将\Tridion\SiteEdit 2009/tridon.logging.config更改为日志文件:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53" />
</configSections>
<loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="General" logWarningsWhenNoCategoriesMatch="false">
<listeners>
<add name="Log File" fileName="C:TridionlogSiteEdit.log" formatter="Tridion Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53" traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53" />
</listeners>
<formatters>
<add template="{timestamp} &lt;{win32ThreadId}&gt; {message}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53" name="Trace Text Formatter" />
<add template="{message}&#xA;&#xA;Component: {keyvalue(component)}&#xA;Errorcode: {keyvalue(errorcode)}&#xA;User: {keyvalue(username)}&#xA;&#xA;{keyvalue(stacktrace)}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53" name="Tridion Text Formatter" />
</formatters>
<categorySources>
<add switchValue="All" name="General" />
</categorySources>
<specialSources>
<allEvents switchValue="All" name="All Events">
<listeners>
<add name="Log File" />
</listeners>
</allEvents>
<notProcessed switchValue="All" name="Unprocessed Category" />
<errors switchValue="All" name="Logging Errors &amp; Warnings" />
</specialSources>
</loggingConfiguration>
</configuration>

一旦将日志记录配置为写入文件,我们就可以看到异常的堆栈跟踪:

读取传入请求时出错
对象引用不是设置为对象的实例

组件:SiteEdit.Proxy
错误代码:0
用户:NT AUTHORITY\IUSR

StackTrace信息详细信息:
位于Tridion.Web.UI.SiteEdit.Proxy.Helper.CopyRequestCookies(HttpRequest请求,CookieContainer CookieContainer)
Tridion.Web.UI.SiteEdit.Proxy.Request.RequestFactory.CreateRequest(HttpRequest请求)
Tridion.Web.UI.SiteEdit.Proxy.Request.RequestFactory.CreateRequest(HttpRequest请求)
Tridion.Web.UI.SiteEdit.Proxy.RedirectModule.context_BeginRequest(对象发送器,EventArgs e)

由于对象引用错误出现在一个名为"CopyRequestCookies"的方法中,我们决定查看我们的cookies(这是有意义的,因为关闭和重新打开浏览器会导致SiteEdit再次工作,但仅针对单个请求)。

果不其然,我们有一个奇怪的cookie,它被用来简单地验证用户是否打开了cookie。javascript代码(我想我的开发人员是从网上得到的)是:

document.cookie = 'CookieTest';
if (document.cookie == "") {
$("form").append('<div class="master-error"><p>Cookies are not enabled</p></div>');
}

请注意,cookie没有值(典型的JS是document.cookie = 'name=value';)。我们认为,在代理逻辑中,它将为代理站点提交的cookie传递到暂存站点,有一些代码没有预料到一个没有价值的cookie(在Fiddler中,你可以看到cookie只是作为"CookieTest;"传递),但并没有进行防御编码来处理这种情况。

通过更改我们的代码以将值应用于cookiedocument.cookie = 'CookieTest=true',SiteEdit代理可以正常工作。

最新更新