我正在使用.Net dll Newtonsoft.Json in my C# TBB来处理组件并生成Json数据.我已经添加了这个dll GAC[Global Assembly Cache],它也可以运行.但有时它不起作用,我发布时出现以下错误:
JScriptException: Expression 'RenderComponentPresentation()' had error 'Could not load file or assembly 'Newtonsoft.Json, Version=4.0.5.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.'
但是当我在Tridion中预览页面时它运行正常.要解决此问题,我们重新启动Tridion Services,重新启动后,我们发布了一个很好的页面.但是这个问题一再出现.有没有办法永久解决这个问题?
最近,当我已经在发布过程中再次发布同一页面时,我可以重现问题.第二次发布尝试返回上述错误,但第二次发布尝试失败后第一次发布尝试完成并返回Success.任何想法为什么这种奇怪的行为.
在Tridion Explorer中打开各种弹出窗口时,消息中心会显示以下消息:
Couldn't retrieve data from 1 datasources
Run Code Online (Sandbox Code Playgroud)
这意味着什么,我该如何预防呢?
编辑:是的 - 所有说UGC的人都是对的.实际上,问题不在于引用Web服务,而在于它们无法正常工作.因此,如果您正在设置UGC,请确保(使用您的浏览器)检查OData服务不仅可用,但它们对查询做出正确响应.
我为用户生成的内容配置了Tridion,并使用默认/演示模板创建了一个网页,该模板使用文本输入字段来提供评论作者的姓名.注释被接受,但在显示时,它们将用户的名称显示为"null".我认为问题在于存储名称,而不是检索它.如果我在Content Manager UI中创建注释,然后返回到我的测试网页,则会显示注释,其中包含主持人的姓名.
面向公众的UGC Web服务配置了AllowAnonymousClaimProcessor.(如果没有这个,评论根本不会保存.)日志记录显示这显然成功地将缺少的taf:claim:contentdelivery:webservice:user转换为基于跟踪ID的用户.
当然,这个想法不是将其用作评论的作者.在日志记录中,您还可以看到来自网页中文本输入的字符串"测试用户",并且这似乎映射到author=com.tridion.storage.ugc.UGCUser@2598a35d,但不久之后存储层搜索ID为null的用户并找到一个.
我怀疑这是一个配置问题,但正如你所看到的,它很复杂,而且我不确定在哪里可以进一步查看.关于它应该如何工作的解释将与进行实验的更具体的建议一样受欢迎.
记录输出如下.我已经修剪了很多但是它仍然很长,因为我不知道哪些位可能证明相关:
2012-06-03 13:00:10,662 WARN AmbientDataContext - There is no current ambient data context - the ambient data framework is not properly initialised
2012-06-03 13:00:10,668 DEBUG AmbientDataContext - Setting current ambient data context: com.tridion.ambientdata.web.WebContext
2012-06-03 13:00:10,903 DEBUG ClaimStore - put: uri=taf:response:cookie:generation, value=true
2012-06-03 13:00:10,906 DEBUG WebContext - setCurrentClaimStore: com.tridion.ambientdata.dotnet.DotNetClaimStore@483a0ab1, thread: Thread-1
2012-06-03 13:00:10,922 DEBUG ClaimStore - put: uri=taf:request:uri, value=/odata.svc/ItemStats(PublicationId=19,Id=320,Type=16)
2012-06-03 13:00:10,923 DEBUG ClaimStore - put: uri=taf:request:full_url, value=http://cdweb.visitorsweb.local/odata.svc/ItemStats(PublicationId=19,Id=320,Type=16)
2012-06-03 13:00:10,936 DEBUG ClaimStore - put: uri=taf:request:headers, …Run Code Online (Sandbox Code Playgroud) 注意与Tridion UGC注释完全相同的问题将作者显示为null
从演示文稿网站发布评论时,用户将使用ID null保存.这会导致下一条评论显示为从评论的第一个用户发布并且ID为null.
cd核心日志文件显示AnonymousPostClaimProcessor正在使用tracking id.
DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:user, value=tridion_2151731a-97d2-4a90-800f-bee20074b970
TRACE ODataInputParser - Parsing following queryString: /Comments
TRACE BasePostClaimProcessor - User ID: tridion_2151731a-97d2-4a90-800f-bee20074b970, Request URI: /odata.svc/Comments
DEBUG PostAllowedByEveryoneClaimProcessor - Allowing user 'tridion_2151731a-97d2-4a90-800f-bee20074b970' to post on: /odata.svc/Comments
DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:post:allowed, value=true
DEBUG ClaimStore - put: uri=taf:response:cookie:generation, value=true
DEBUG WebContext - setCurrentClaimStore: com.tridion.ambientdata.dotnet.DotNetClaimStore@74002515, thread: Thread-1
DEBUG ClaimStore - put: uri=taf:request:uri, value=/odata.svc/Comments
DEBUG ClaimStore - put: uri=taf:request:full_url, value=http://staging:8080/odata.svc/Comments
DEBUG ClaimStore - …Run Code Online (Sandbox Code Playgroud)