gpt4 book ai didi

java - 将 PDF 文档索引到 Solr - 错误 500 java.lang.NoClassDefFoundError : org/eclipse/jetty/server/MultiParts

转载 作者:行者123 更新时间:2023-12-04 17:26:18 24 4
gpt4 key购买 nike

我正在尝试为我的 Apache Solr Core 测试 PDF 文档的索引。

我找到了以下说明: 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>

有人有想法吗?

谢谢!

最佳答案

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

将 Solr 降级到 8.5.1 应该可以解决问题,直到问题在新的 Solr 版本中得到解决。

关于java - 将 PDF 文档索引到 Solr - 错误 500 java.lang.NoClassDefFoundError : org/eclipse/jetty/server/MultiParts,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63070107/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com