在复合模板中发布/渲染某段代码时,其中一个环境突然出现问题。这是一个 DTAP 环境,问题只发生在生产环境(一如既往;-),那里有两台 CMS 机器和两个发布者。都表现出相同的行为。
导致问题的代码是:
StructureGroup SG = (StructureGroup)engine.GetObject("/webdav/pub/root/etc/etc...");
模板构建器中的错误是:
System.Net.WebException: The underlying connection was closed: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.77.66.136:80
bij System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
bij System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
bij System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
--- Einde van intern uitzonderingsstackpad ---
bij System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
bij System.Net.HttpWebRequest.GetRequestStream()
bij System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
bij Tridion.ContentManager.Templating.CompoundTemplates.DomainModel.Proxy.CompoundTemplateWebService.GetDebuggingState(String debuggerSessionId, String lastLogMessageId)
bij Tridion.ContentManager.Templating.CompoundTemplates.DomainModel.DebugObject.Start(Template template, Object debugItem, LoggingOptions loggingOptions)
奇怪的是,我们并没有真正尝试访问外部服务器。至少,它看起来是这样的。也许我在 Tridion 的工作方式中遗漏了一些东西。我相当确定这是一个安全问题,但我不知道去哪里找。
最佳答案
我在 Nickoli 和 Nuno 的建议的帮助下找出了错误的问题。
当模板生成器尝试从网络中的某个位置运行时,会显示此错误,该位置无权访问代码。我还以为跟有关引擎.GetObject 方法,因为错误只会在运行该方法时出现。
最后代码中也有错误,但这与错误的递归方法有关。
关于tridion - 在复合模板中使用 C# 进行渲染时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10481611/