Index PDF Documents to Solr – Error 500 java.lang.NoClassDefFoundError: org/eclipse/jetty/server/MultiParts

huangapple go评论115阅读模式
英文:

Index PDF Documents to Solr - Error 500 java.lang.NoClassDefFoundError: org/eclipse/jetty/server/MultiParts

问题

我正在尝试将PDF文档的索引添加到我的Apache Solr核心。

我找到了以下的指示:
https://lucene.apache.org/solr/guide/8_0/uploading-data-with-solr-cell-using-apache-tika.html#configuring-the-extractingrequesthandler-in-solrconfig-xml

我已经在我的solrconfig.xml中添加了必要的

<lib dir="${solr.install.dir:../../..}/contrib/extraction/lib" regex=".*\.jar" />
<lib dir="${solr.install.dir:../../..}/dist/" regex="solr-cell-\d.*\.jar" />

我还为索引PDF文档添加了RequestHandler

<requestHandler name="/update/extract"
                startup="lazy"
                class="solr.extraction.ExtractingRequestHandler" >
    <lst name="defaults">
        <str name="lowernames">true</str>
        <str name="fmap.content">_text_</str>
    </lst>
</requestHandler>

之后,我重新启动了Solr服务器,然后尝试使用curl来索引PDF文档:

curl 'http://localhost:8983/solr/test/update/extract?literal.id=doc1&commit=true' -F "myfile=@C:\Workspace\solr\solr-8.6.0\docs\pdf\test.pdf"

我期望文档被索引,但实际上我收到了一个Error 500 java.lang.NoClassDefFoundError: org/eclipse/jetty/server/MultiParts的错误。

<html> <head> <meta http-equiv="Content-Type"
> content="text/html;charset=utf-8"/> <title>Error 500
> java.lang.NoClassDefFoundError:
> org/eclipse/jetty/server/MultiParts</title> </head> <body><h2>HTTP
> ERROR 500 java.lang.NoClassDefFoundError:
> org/eclipse/jetty/server/MultiParts</h2> <table>
> <tr><th>URI:</th><td>/solr/test/update/extract</td></tr>
> <tr><th>STATUS:</th><td>500</td></tr>
> <tr><th>MESSAGE:</th><td>java.lang.NoClassDefFoundError:
> org/eclipse/jetty/server/MultiParts</td></tr>
> <tr><th>SERVLET:</th><td>default</td></tr> <tr><th>CAUSED
> BY:</th><td>java.lang.NoClassDefFoundError:
> org/eclipse/jetty/server/MultiParts</td></tr> </table> <h3>Caused
> by:</h3><pre>java.lang.NoClassDefFoundError:
> org/eclipse/jetty/server/MultiParts
>         at org.apache.solr.servlet.SolrRequestParsers.cleanupMultipartFiles(SolrRequestParsers.java:624)
>         at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:443)
>         at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:345)
>         at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
>         at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
>         at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
>         at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:590)
>         at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
>         at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
>         at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1610)
>         at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
>         at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1300)
>         at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
>         at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
>         at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1580)
>         at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
>         at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1215)
>         at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>         at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
>         at org.eclipse.jetty.server.handler.InetAccessHandler.handle(InetAccessHandler.java:177)
>         at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
>         at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
>         at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:322)
>         at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
>         at org.eclipse.jetty.server.Server.handle(Server.java:500)
>         at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
>         at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)
>         at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
>         at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
>         at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
>         at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
>         at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
>         at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
>         at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
>         at java.lang.Thread.run(Unknown Source) </pre>
> 
> </body> </html>
> 
> 有人有想法吗?
> 
> 谢谢!


<details>
<summary>英文:</summary>

I&#39;m trying to test an index of PDF documents to my Apache Solr Core.

I found the following instruction:
https://lucene.apache.org/solr/guide/8_0/uploading-data-with-solr-cell-using-apache-tika.html#configuring-the-extractingrequesthandler-in-solrconfig-xml

I added the neccessary **libraries** to my ```solrconfig.xml```:

    &lt;lib dir=&quot;${solr.install.dir:../../..}/contrib/extraction/lib&quot; regex=&quot;.*\.jar&quot; /&gt;
    &lt;lib dir=&quot;${solr.install.dir:../../..}/dist/&quot; regex=&quot;solr-cell-\d.*\.jar&quot; /&gt;

I also added the **RequestHandler** for indexing the PDF documents:

    &lt;requestHandler name=&quot;/update/extract&quot;
                startup=&quot;lazy&quot;
                class=&quot;solr.extraction.ExtractingRequestHandler&quot; &gt;
        &lt;lst name=&quot;defaults&quot;&gt;
            &lt;str name=&quot;lowernames&quot;&gt;true&lt;/str&gt;
            &lt;str name=&quot;fmap.content&quot;&gt;_text_&lt;/str&gt;
        &lt;/lst&gt;
    &lt;/requestHandler&gt;

Afterwards, I restarted my Solr server and then tried to index a PDF document by using **curl**:

    curl &#39;http://localhost:8983/solr/test/update/extract?literal.id=doc1&amp;commit=true&#39; -F &quot;myfile=@C:\Workspace\solr\solr-8.6.0\docs\pdf\test.pdf&quot;


I expected the document to be indexed, but instead I get an ```Error 500 java.lang.NoClassDefFoundError: org/eclipse/jetty/server/MultiParts```:

    

    &gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv=&quot;Content-Type&quot;
    &gt; content=&quot;text/html;charset=utf-8&quot;/&gt; &lt;title&gt;Error 500
    &gt; java.lang.NoClassDefFoundError:
    &gt; org/eclipse/jetty/server/MultiParts&lt;/title&gt; &lt;/head&gt; &lt;body&gt;&lt;h2&gt;HTTP
    &gt; ERROR 500 java.lang.NoClassDefFoundError:
    &gt; org/eclipse/jetty/server/MultiParts&lt;/h2&gt; &lt;table&gt;
    &gt; &lt;tr&gt;&lt;th&gt;URI:&lt;/th&gt;&lt;td&gt;/solr/test/update/extract&lt;/td&gt;&lt;/tr&gt;
    &gt; &lt;tr&gt;&lt;th&gt;STATUS:&lt;/th&gt;&lt;td&gt;500&lt;/td&gt;&lt;/tr&gt;
    &gt; &lt;tr&gt;&lt;th&gt;MESSAGE:&lt;/th&gt;&lt;td&gt;java.lang.NoClassDefFoundError:
    &gt; org/eclipse/jetty/server/MultiParts&lt;/td&gt;&lt;/tr&gt;
    &gt; &lt;tr&gt;&lt;th&gt;SERVLET:&lt;/th&gt;&lt;td&gt;default&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th&gt;CAUSED
    &gt; BY:&lt;/th&gt;&lt;td&gt;java.lang.NoClassDefFoundError:
    &gt; org/eclipse/jetty/server/MultiParts&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;h3&gt;Caused
    &gt; by:&lt;/h3&gt;&lt;pre&gt;java.lang.NoClassDefFoundError:
    &gt; org/eclipse/jetty/server/MultiParts
    &gt;         at org.apache.solr.servlet.SolrRequestParsers.cleanupMultipartFiles(SolrRequestParsers.java:624)
    &gt;         at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:443)
    &gt;         at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:345)
    &gt;         at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
    &gt;         at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
    &gt;         at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    &gt;         at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:590)
    &gt;         at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
    &gt;         at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
    &gt;         at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1610)
    &gt;         at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
    &gt;         at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1300)
    &gt;         at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
    &gt;         at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
    &gt;         at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1580)
    &gt;         at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
    &gt;         at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1215)
    &gt;         at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    &gt;         at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
    &gt;         at org.eclipse.jetty.server.handler.InetAccessHandler.handle(InetAccessHandler.java:177)
    &gt;         at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
    &gt;         at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
    &gt;         at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:322)
    &gt;         at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
    &gt;         at org.eclipse.jetty.server.Server.handle(Server.java:500)
    &gt;         at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
    &gt;         at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)
    &gt;         at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
    &gt;         at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
    &gt;         at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
    &gt;         at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
    &gt;         at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
    &gt;         at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
    &gt;         at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
    &gt;         at java.lang.Thread.run(Unknown Source) &lt;/pre&gt;
    &gt; 
    &gt; &lt;/body&gt; &lt;/html&gt;


Has anyone an idea?

Thanks!

</details>


# 答案1
**得分**: 1

这是Solr 8.6.0和Solr 8.6.1的问题。请查看https://issues.apache.org/jira/browse/SOLR-14768

在问题在新的Solr版本中得到修复之前,将Solr降级至8.5.1版本应该可以解决这个问题。

<details>
<summary>英文:</summary>

It is an issue of Solr 8.6.0 and Solr 8.6.1. See https://issues.apache.org/jira/browse/SOLR-14768

Downgrading Solr to 8.5.1 should solve it until the issue is fixed in a new Solr release.

</details>



huangapple
  • 本文由 发表于 2020年7月24日 16:46:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/63070107.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定