2
votes

I'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:

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

I also added the RequestHandler for indexing the PDF documents:

<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>

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

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"

I expected the document to be indexed, but instead I get an 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>

Has anyone an idea?

Thanks!

1
is the jetty-server jar misssing? jetty-server-9.4.11.v20180605.jar? - Abhijit Bashetti
Sounds like you have a mix of Jetty versions across your Jetty jar files. Ensure that they are all running the same version. If you use maven/gradle/ivy/etc, just add the jetty-bom properly to your build files to align the versions properly. - Joakim Erdfelt
@JoakimErdfelt, I'm getting exactly the same error with Solr 8.6.0 as it comes from the website. Suppose it uses embedded Jetty server, because I haven't installed it separately. - Svetlozar Stoyanov
You have other org.eclipse.jetty.server. packaged classes being loaded (that's obvious from the stacktrace). but the org.eclipse.jetty.server.MultiParts isn't loading. that can only happen when you have multiple jetty-server jars on different versions in your classpath. - Joakim Erdfelt
Thasn't look that the problem is because of different jetty server jars. Because a) there is no other jetty jars on the host and b) all jetty jars installed are from solr package and are from save version. - Svetlozar Stoyanov

1 Answers

0
votes

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.