Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-14086

Tika ClassNotFound error due to commons-compress in solr-core dependency

    XMLWordPrintableJSON

    Details

      Description

      Opening on behalf of Tim Allison since he found this in SOLR-14054.

      From lucene-solr repo directory:

      ant clean clean-maven-build clean-jars jar-checksums
      cd solr
      ant package
      cp package/solr-9.0.0-SNAPSHOT.tgz ~/Downloads
      

      New terminal

      cd ~/Downloads
      wget https://issues.apache.org/jira/secure/attachment/12988870/tika-integration-example-9.0.0-SNAPSHOT.tgz
      tar zxvf tika-integration-example-9.0.0-SNAPSHOT.tgz
      wget https://issues.apache.org/jira/secure/attachment/12988868/test-documents.7z
      tar zxvf solr-9.0.0-SNAPSHOT.tgz
      cd solr-9.0.0-SNAPSHOT
      ./bin/solr start
      ./bin/solr create -c tika-integration-example -d ~/Downloads/tika-integration-example/conf
      curl 'http://localhost:8983/solr/tika-integration-example/update/extract?literal.id=doc1&commit=true' -F "myfile=@$HOME/Downloads/test-documents.7z"
      

      You should see an error like:

      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
      <title>Error 500 java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.compress.archivers.sevenz.Coders</title>
      </head>
      <body><h2>HTTP ERROR 500 java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.compress.archivers.sevenz.Coders</h2>
      <table>
      <tr><th>URI:</th><td>/solr/tika-integration-example/update/extract</td></tr>
      <tr><th>STATUS:</th><td>500</td></tr>
      <tr><th>MESSAGE:</th><td>java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.compress.archivers.sevenz.Coders</td></tr>
      <tr><th>SERVLET:</th><td>default</td></tr>
      <tr><th>CAUSED BY:</th><td>java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.compress.archivers.sevenz.Coders</td></tr>
      </table>
      <h3>Caused by:</h3><pre>java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.compress.archivers.sevenz.Coders
      	at org.apache.commons.compress.archivers.sevenz.SevenZFile.readEncodedHeader(SevenZFile.java:437)
      	at org.apache.commons.compress.archivers.sevenz.SevenZFile.readHeaders(SevenZFile.java:355)
      	at org.apache.commons.compress.archivers.sevenz.SevenZFile.&lt;init&gt;(SevenZFile.java:241)
      	at org.apache.commons.compress.archivers.sevenz.SevenZFile.&lt;init&gt;(SevenZFile.java:108)
      	at org.apache.commons.compress.archivers.sevenz.SevenZFile.&lt;init&gt;(SevenZFile.java:262)
      	at org.apache.tika.parser.pkg.PackageParser.parse(PackageParser.java:257)
      	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
      	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
      	at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:143)
      	at org.apache.solr.handler.extraction.ExtractingDocumentLoader.load(ExtractingDocumentLoader.java:228)
      	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:68)
      	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:208)
      	at org.apache.solr.core.SolrCore.execute(SolrCore.java:2582)
      	at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:799)
      	at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:578)
      	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:419)
      	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:351)
      	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:1607)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1297)
      	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:1577)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1212)
      	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.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:270)
      	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.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
      	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
      	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.base/java.lang.Thread.run(Thread.java:834)
      </pre>
      
      </body>
      </html>
      

        Attachments

        1. SOLR-14086.patch
          2 kB
          Kevin Risden
        2. test-documents.7z
          65 kB
          Kevin Risden
        3. tika-integration-example-9.0.0-SNAPSHOT.tgz
          3 kB
          Kevin Risden

          Issue Links

            Activity

              People

              • Assignee:
                krisden Kevin Risden
                Reporter:
                tallison Tim Allison
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: