Solr Tomcat org.apache.solr.common.SolrException:延迟加载错误 [英] Solr Tomcat org.apache.solr.common.SolrException: lazy loading error

查看:47
本文介绍了Solr Tomcat org.apache.solr.common.SolrException:延迟加载错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Ubuntu 14.04

Ubuntu 14.04

我使用 sudo apt-get install solr-tomcat 安装.

I installed using sudo apt-get install solr-tomcat.

似乎核心"功能已安装并且正在运行,但没有任何插件(或者我只是不知道在哪里查看).

It seems the "core" functionality was installed and is working, but not any Plugins (or I just don't know where to look).

我正在尝试使用 extract 函数,这是一个插件.

I am trying to use the extract function, which is a Plugin.

当我尝试时,我得到了这个

When I attempt, I get this

org.apache.solr.common.SolrException: 延迟加载错误在 org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.getWrappedHandler(RequestHandlers.java:260)在 org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.handleRequest(RequestHandlers.java:242)在 org.apache.solr.core.SolrCore.execute(SolrCore.java:1376)在 org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:365)在 org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:260)在 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)在 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)在 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)在 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)在 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)在 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)在 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)在 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)在 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)在 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)在 org.apache.tomcat.util.net.JioEndpoint$Worker.run(JioEndpoint.java:489)在 java.lang.Thread.run(Thread.java:745)引起:org.apache.solr.common.SolrException:加载类'solr.extraction.ExtractingRequestHandler'时出错在 org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:414)在 org.apache.solr.core.SolrCore.createInstance(SolrCore.java:419)在 org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:455)在 org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.getWrappedHandler(RequestHandlers.java:251)……还有 16 个引起:java.lang.ClassNotFoundException:solr.extraction.ExtractingRequestHandler在 java.net.URLClassLoader$1.run(URLClassLoader.java:366)在 java.net.URLClassLoader$1.run(URLClassLoader.java:355)在 java.security.AccessController.doPrivileged(Native Method)在 java.net.URLClassLoader.findClass(URLClassLoader.java:354)在 java.lang.ClassLoader.loadClass(ClassLoader.java:425)在 java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789)在 java.lang.ClassLoader.loadClass(ClassLoader.java:358)在 java.lang.Class.forName0(Native Method)在 java.lang.Class.forName(Class.java:274)在 org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:398)... 19 更多

org.apache.solr.common.SolrException: lazy loading error at org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.getWrappedHandler(RequestHandlers.java:260) at org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.handleRequest(RequestHandlers.java:242) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1376) at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:365) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:260) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.solr.common.SolrException: Error loading class 'solr.extraction.ExtractingRequestHandler' at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:414) at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:419) at org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:455) at org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.getWrappedHandler(RequestHandlers.java:251) ... 16 more Caused by: java.lang.ClassNotFoundException: solr.extraction.ExtractingRequestHandler at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:274) at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:398) ... 19 more

我手动下载了最新版本只是为了进行调查,并且确实找到了一个extraction"目录,并且在其中找到了一个名为 ExtractingRequestHandler.java 的文件.

I manually downloaded the latest version just to investigate, and did find an "extraction" directory, and, within, a file called ExtractingRequestHandler.java.

我不是 Java 人.我寻找了与错误指示类似的路径,并找到了/usr/share/maven-repo/org/apache/solr/solr-core",它与org.apache.solr.core"并不严格对应.所以,我不愿意在这里假设任何事情.

I'm not a Java guy. I looked for a similar path to what the error indicated and found "/usr/share/maven-repo/org/apache/solr/solr-core", which does not strictly correspond with "org.apache.solr.core". So, I'm hesitant to assume anything here.

Solr 正在搜索提取"目录 - 我只是不确定在哪里.

Solr is searching for the "extraction" directory - I'm just not sure where.

我的 solrconfig.xml 文件有这个

My solrconfig.xml file has this

<requestHandler name="/update/extract" 
                  startup="lazy"
                  class="solr.extraction.ExtractingRequestHandler" >
    <lst name="defaults">
      <!-- All the main content goes into "text"... if you need to return
           the extracted text or do highlighting, use a stored field. -->
      <str name="fmap.content">text</str>
      <str name="lowernames">true</str>
      <str name="uprefix">ignored_</str>

      <!-- capture link hrefs but ignore div attributes -->
      <str name="captureAttr">true</str>
      <str name="fmap.a">links</str>
      <str name="fmap.div">ignored_</str>
    </lst>
  </requestHandler>

我尝试将该提取目录复制到这两个目录中:/usr/share/maven-repo/org/apache/solr//etc/solr

I tried copying that extraction directory into both these directories: /usr/share/maven-repo/org/apache/solr/ /etc/solr

希望要么是'home' solr 目录,但不走运.

in hopes that either was the 'home' solr directory, no luck.

我添加了

<lib dir="/var/lib/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction" />

到我的 solrconfig.xml 并在 tomcat 日志中观察到这一点:

to my solrconfig.xml and observed this in tomcat logs:

信息:向类加载器添加file:/var/lib/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/ExtractingRequestHandler.java"

INFO: Adding 'file:/var/lib/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/ExtractingRequestHandler.java' to classloader

仍然没有运气.

提前致谢.

我检查了我的 tomcat 日志,看到以下内容:

I checked my tomcat logs and I see the following:

2014 年 11 月 23 日上午 12:53:44 org.apache.solr.core.RequestHandlersinitHandlersFromConfig INFO:添加惰性 requestHandler:solr.extraction.ExtractingRequestHandler

Nov 23, 2014 12:53:44 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig INFO: adding lazy requestHandler: solr.extraction.ExtractingRequestHandler

这很奇怪,因为它表明在 solr.extraction.ExtractingRequestHandler 处创建了一个lazy requestHandler",这与错误相矛盾:

It's odd because it indicates that a "lazy requestHandler" was created at solr.extraction.ExtractingRequestHandler, which contradicts the error:

加载类solr.extraction.ExtractingRequestHandler"时出错

Error loading class 'solr.extraction.ExtractingRequestHandler'

如果我从上面的配置中删除startup = 'lazy'"属性,当我重新启动Tomcat时,会出现错误:

If I remove the "startup = 'lazy'" attribute from the config above, when I restart Tomcat, there is an error:

严重:org.apache.solr.common.SolrException:加载类时出错'solr.extraction.ExtractingRequestHandler'

SEVERE: org.apache.solr.common.SolrException: Error loading class 'solr.extraction.ExtractingRequestHandler'

推荐答案

您似乎要向类路径添加源目录 - 您需要将编译版本及其依赖项添加到类路径.

It seems you're adding a source directory to the classpath - you'll need to add the compiled version with its dependencies to the classpath instead.

在正态分布(来自 Solr 主页)中,它位于 contrib/extraction/lib 中,它还捆绑了提取模块的其他依赖项.

In the normal distribution (from the Solr homepage) this is located in contrib/extraction/lib, where it also bundles the other dependencies for the extraction module.

来自该目录中的 README.txt:

From the README.txt in that directory:

您需要启动并运行 Solr.然后,只需添加解压 JAR 文件,以及 Tika 依赖项(在 ./lib 文件夹中)到您的 Solr Home lib 目录.请参阅 http://wiki.apache.org/solr/ExtractingRequestHandler 以获取有关将其挂接的更多详细信息和配置.

Getting Started

You will need Solr up and running. Then, simply add the extraction JAR file, plus the Tika dependencies (in the ./lib folder) to your Solr Home lib directory. See http://wiki.apache.org/solr/ExtractingRequestHandler for more details on hooking it in and configuring.

尽管您似乎正在遵循如何执行此操作的旧版本(从您的请求处理程序名称).当前配置在社区 wiki,分发版中还捆绑了一个完整的示例.

Although it seems you're following an older version of how to do this (from your request handler name). The current configuration is detailed in the community wiki, and there's a complete example bundled in the distribution as well.

检索和提取文件:

$ wget http://<mirror>/lucene/solr/4.10.2/solr-4.10.2.tgz
$ tar xvzf solr-4.10.2.tgz
$ cd solr-4.10.2/contrib/extraction/lib/
$ ls
apache-mime4j-core-0.7.2.jar    pdfbox-1.8.4.jar
apache-mime4j-dom-0.7.2.jar     poi-3.10.1.jar
aspectjrt-1.6.11.jar            poi-ooxml-3.10.1.jar
bcmail-jdk15-1.45.jar           poi-ooxml-schemas-3.10.1.jar
bcprov-jdk15-1.45.jar           poi-scratchpad-3.10.1.jar
boilerpipe-1.1.0.jar            rome-0.9.jar
commons-compress-1.7.jar        tagsoup-1.2.1.jar
dom4j-1.6.1.jar                 tika-core-1.5.jar
fontbox-1.8.4.jar               tika-parsers-1.5.jar
icu4j-53.1.jar                  tika-xmp-1.5.jar
isoparser-1.0-RC-1.jar          vorbis-java-core-0.1.jar
jdom-1.0.jar                    vorbis-java-tika-0.1.jar
jempbox-1.8.4.jar               xercesImpl-2.9.1.jar
jhighlight-1.0.jar              xmlbeans-2.6.0.jar
juniversalchardet-1.0.3.jar     xmpcore-5.1.2.jar
metadata-extractor-2.6.2.jar    xz-1.4.jar

这篇关于Solr Tomcat org.apache.solr.common.SolrException:延迟加载错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆