一千萬個為什麽

搜索

DXA 1.2 RichText內部組件鏈接解析

  • I am Using DXA 1.2 version (.Net is delivery side).
  • Tridion 2013 SP1 i am using
  • I have a rich text field in my schema, in that i have added a Internal Component Link (which has published page).
  • I understand that for the rich text field, i can use "RichText" or "string" type in model. (I tried both).
  • When i run/debug the solution from my local machine, it is failing and the error is as below from "DefaultModelBuilder.cs" line 662
  • Originally error caused from the class "TridionLinkResolver.cs" and method "ResolveBinaryLink" line 88

被抓住了

Stack Trace是:

        java.lang.ExceptionInInitializerError
            at com.tridion.linking.AbstractLink.(AbstractLink.java:69)
            at com.tridion.linking.BinaryLink.(BinaryLink.java:67)
        Caused by: java.lang.RuntimeException: Fatal error, unable to load the Linking Module
            at com.tridion.linking.Linking.reloadInstance(Linking.java:117)
            at com.tridion.linking.Linking.(Linking.java:87)
            ... 2 more
        Caused by: com.tridion.configuration.ConfigurationException: org.xml.sax.SAXParseException; lineNumber: 36; columnNumber: 2; The markup in the document following the root element must be well-formed.
            at com.tridion.configuration.XMLConfigurationReader.readConfiguration(XMLConfigurationReader.java:125)
            at com.tridion.configuration.XMLConfigurationReader.readConfiguration(XMLConfigurationReader.java:97)
            at com.tridion.configuration.XMLConfigurationReader.readConfiguration(XMLConfigurationReader.java:83)
            at com.tridion.Controller.loadConfiguration(Controller.java:404)
            at com.tridion.Controller.(Controller.java:116)
            at com.tridion.Controller.(Controller.java:161)
            at com.tridion.linking.Linking.(Linking.java:106)
            at com.tridion.linking.Linking.reloadInstance(Linking.java:113)
            ... 3 more
        Caused by: org.xml.sax.SAXParseException; lineNumber: 36; columnNumber: 2; The markup in the document following the root element must be well-formed.
            at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
            at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
            at com.tridion.configuration.XMLConfigurationReader.readConfiguration(XMLConfigurationReader.java:119)
            ... 10 more
           at Codemesh.JuggerNET.JavaClass.ThrowException(Exception ex)
           at Codemesh.JuggerNET.NTypeValue.Throw(Int64 inst)
           at Codemesh.JuggerNET.JavaClass.ThrowTypedException(Int64 inst)
           at Codemesh.JuggerNET.JavaMethod.CallObject(JavaProxy jpo, JavaMethodArguments args)
           at Com.Tridion.Linking.BinaryLink..ctor(Int32 publicationId)
           at Tridion.ContentDelivery.Web.Linking.BinaryLink..ctor(Int32 publicationId)
           at Sdl.Web.Tridion.Linking.TridionLinkResolver.ResolveBinaryLink(TcmUri tcmUri, Int32 localizationId) in c:\Code Base\InfoMAX\Dev\Sdl.Web.Tridion\Linking\TridionLinkResolver.cs:line 88
           at Sdl.Web.Tridion.Linking.TridionLinkResolver.ResolveLink(TcmUri tcmUri, Boolean resolveToBinary, Localization localization) in c:\Code Base\InfoMAX\Dev\Sdl.Web.Tridion\Linking\TridionLinkResolver.cs:line 68
           at Sdl.Web.Tridion.Linking.TridionLinkResolver.ResolveLink(String sourceUri, Boolean resolveToBinary, Localization localization) in c:\Code Base\InfoMAX\Dev\Sdl.Web.Tridion\Linking\TridionLinkResolver.cs:line 35
           at Sdl.Web.Tridion.Mapping.DefaultRichTextProcessor.ResolveRichText(XmlDocument doc, Localization localization) in c:\Code Base\InfoMAX\Dev\Sdl.Web.Tridion\Mapping\DefaultRichTextProcessor.cs:line 78
           at Sdl.Web.Tridion.Mapping.DefaultRichTextProcessor.ProcessRichText(String xhtml, Localization localization) in c:\Code Base\InfoMAX\Dev\Sdl.Web.Tridion\Mapping\DefaultRichTextProcessor.cs:line 46
           at Sdl.Web.Tridion.Mapping.DefaultModelBuilder.MapFieldValues(IField field, Type modelType, Boolean multival, MappingData mapData) in c:\Code Base\InfoMAX\Dev\Sdl.Web.Tridion\Mapping\DefaultModelBuilder.cs:line 633

問題:</強>

  • DXA Link Resolving will work only from server not from local machine?
  • If it is not working from local, debugging entity view will fail when having component link in rich text field. Is my understanding right? or I missed something?
  • Now, deployed and tried from server, no error in entity view. But i dont understand why the link is resolving with port number. Eg: https://mydomain.com:48700/mypubpath/mypubpath/mysg/mypage.html. I think link is resolving combination of cd_link_conf+ Broker DB page url (Porotocol+domain+port+path+pageurl from broker). Already page url in broker has "publication path, so i see pub path adding twice)
  • I expect the resolved URL without port number as https://mydomain.com/mypubpath/mysg/mypage.html

最佳答案

  1. 如果您在本地計算機上正確部署DXA Web App(包括CD工件,如許可證文件),則所有功能都將起作用。
  2. 請參閱第1點。如果您正在調試,一切都應該有效。
  3. DXA鏈接解析只是建立在CD鏈接解析上。您的 cd_link_conf.xml 看起來如何?

更新</強>

看起來您最初省略的堆棧跟蹤部分包含有關問題的非常有價值的信息:看起來您的 cd_link_conf.xml 在本地計算機上的格式不正確。堆棧跟蹤甚至顯示問題所在的亞麻布。

如果您不使用默認的HTTP(S)端口,我仍然不明白為什麽您希望鏈接URL沒有端口號,但最好從 cd_link_conf中刪除所有 Host 條目。 xml </代碼>;應該讓CD Linking生成服務器相對URL(因此整個協議/主機/端口討論變得無關緊要)。

轉載註明原文: DXA 1.2 RichText內部組件鏈接解析