【问题标题】:SOLR 5: Error loading class 'solr.XsltUpdateRequestHandler'SOLR 5:加载类“solr.XsltUpdateRequestHandler”时出错
【发布时间】:2016-02-11 15:05:30
【问题描述】:

在 Solr 4.2.1 上,我可以使用 solr post,现在我已经升级到 5.4 并且当我使用 post 方法时。我收到 Error loading class 'solr.XsltUpdateRequestHandler' 错误。

这是完整的错误:

null:org.apache.solr.common.SolrException: Error loading class 'solr.XsltUpdateRequestHandler'
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:559)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:490)

Caused by: java.lang.ClassNotFoundException: solr.XsltUpdateRequestHandler
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

我在 solrconfig 上使用了以下内容,并且在 solr 启动期间没有错误。

<requestHandler name="/update/xslt" class="solr.XsltUpdateRequestHandler" startup="lazy" />

非常感谢任何帮助。

谢谢

【问题讨论】:

    标签: solr lucene solr4 solr5


    【解决方案1】:

    看起来该处理程序在 4.8 甚至可能更早被弃用。如果它在 5.0 之前完全从 Solr 中删除,我不会感到惊讶,但我在文档中看不到任何关于它的内容。 I pulled up the 4.2.1 docs and even those have the deprecated annotation.

    您可能希望最迟降级到 4.10 以查看是否可以使用该处理程序,然后开始一次升级一个版本,直到错误再次发生。从 4.2.1 跳到 5.4.1 是巨大的。这些版本之间有很多变化。

    如果您不想打扰,我在我的 5.4.1 solrconfig.xml 中进行了快速搜索,发现以下内容:

    <!-- XSLT response writer transforms the XML output by any xslt file found
           in Solr's conf/xslt directory.  Changes to xslt files are checked for
           every xsltCacheLifetimeSeconds.  
        -->
      <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
        <int name="xsltCacheLifetimeSeconds">5</int>
      </queryResponseWriter>
    

    我不知道如何使用它,因为我从来没有理由打扰 xslt,但它看起来是个不错的起点。

    【讨论】:

      【解决方案2】:

      感谢@TMBT 的回复。我能够通过使用它 UpdateRequestHandler 找到解决方案,因为 XsltUpdateRequestHandler 已被弃用。将其更改为 solr.UpdateRequestHandler 后,我能够运行 solr POST 并且成功。

      <requestHandler name="/update/xslt" class="solr.UpdateRequestHandler" startup="lazy" />
      

      【讨论】:

        猜你喜欢
        • 2013-05-30
        • 2023-01-17
        • 2020-07-22
        • 2013-06-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多