【问题标题】:Sitecore - Root item is not definedSitecore - 未定义根项目
【发布时间】:2013-03-12 08:11:53
【问题描述】:

我在尝试使用 TDS 进行部署时遇到了以下错误。我不相信有任何自定义索引。我查看了以下链接并清除了我的 \Data\Indexes 文件夹。

Sitecore Index error - Root Item Not defined

什么会导致这个错误?

这也是我收到错误的网址:http://<hostname>/sitecore

完整的堆栈跟踪:

[InvalidOperationException: Root item is not defined]
   Sitecore.Diagnostics.Assert.IsNotNull(Object value, String message) +59
   Sitecore.Search.Crawlers.DatabaseCrawler.Initialize(Index index) +106
   Sitecore.Search.Index.AddCrawler(ICrawler crawler) +36

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +1255
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +38
   Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj) +91
   Sitecore.Configuration.Factory.AssignProperties(Object obj, Object[] properties) +760
   Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +943
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +305
   Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +858
   Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +795
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +305
   Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +395
   Sitecore.Search.SearchManager.get_SearchConfig() +71
   Sitecore.Search.SearchManager.GetIndex(String id) +43
   Sitecore.Shell.Applications.ShellForm.OnLoad(EventArgs e) +1331

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +1255
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +38
   Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj) +91
   Sitecore.Web.UI.Sheer.ClientPage.OnLoad(EventArgs e) +332
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428

【问题讨论】:

    标签: sitecore


    【解决方案1】:

    如果您浏览到此页面 http://[yourhostname]/sitecore/admin/showconfig.aspx

    搜索 index 元素的任何实例并检查 <Root>path here</Root> 节点路径是否确实存在于您的内容树中

    查看默认索引示例

    <index id="system" type="Sitecore.Search.Index, Sitecore.Kernel">
    <param desc="name">$(id)</param>
    <param desc="folder">__system</param>
    <Analyzer ref="search/analyzer"/>
    <locations hint="list:AddCrawler">
    <core type="Sitecore.Search.Crawlers.DatabaseCrawler,Sitecore.Kernel">
    <Database>core</Database>
    <Root>/sitecore/content</Root>
    <include hint="list:IncludeTemplate">
    <application>{EB06CEC0-5E2D-4DC4-875B-01ADCC577D13}</application>
    </include>
    <Tags>application</Tags>
    <Boost>2.0</Boost>
    </core>
    <core-controlpanel type="Sitecore.Search.Crawlers.DatabaseCrawler,Sitecore.Kernel">
    <Database>core</Database>
    <Root>/sitecore/content/applications/control panel</Root>
    <include hint="list:IncludeTemplate">
    <taskoption>{BDB6FA46-2F76-4BDE-8138-52B56C2FC47E}</taskoption>
    </include>
    <Tags>taskoption</Tags>
    <Boost>1.9</Boost>
    </core-controlpanel>
    <master type="Sitecore.Search.Crawlers.DatabaseCrawler,Sitecore.Kernel">
    <Database>master</Database>
    <Tags>master content</Tags>
    </master>
    </locations>
    </index>
    

    一旦您更正了任何无效的 Root 值,该站点应该会再次运行。

    【讨论】:

      【解决方案2】:

      问题原因

      此问题通常发生在 Sitecore lucene 索引声明但它所引用的&lt;Root&gt; 不在数据库中时。

      注意:如果索引目标的数据库是 web,这可能是因为您没有 published 项目。

      问题修复

      因为您无法访问 Sitecore 桌面,您必须注释掉导致问题的索引。如果您不知道是哪一个,则必须使用简单的旧试验和错误,因为 sitecore 不会告诉您。

      要查看您在系统中声明的所有索引,请转到http://[yourhostname]/sitecore/admin/showconfig.aspx 并搜索&lt;index。这是 App_Config 中声明的所有配置的组合。

      索引如下所示:

      <index id="MyIndexId" type="Sitecore.Search.Index, Sitecore.Kernel">
      

      找到罪魁祸首后,将其注释掉,然后在 Sitecore 中创建或部署缺失的根项目。完成后,重新添加索引。

      【讨论】:

      • 很好的解释和解决方案。谢谢!
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-20
      相关资源
      最近更新 更多