Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-2693

Tika 1.17 uses the wrong classloader for reflection

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.17
    • Fix Version/s: 1.19, 2.0.0
    • Component/s: general
    • Labels:
      None

      Description

      I don't know whether this was addressed in 1.18, but Tika seemingly uses the wrong classloader when loading some classes by reflection.

      In ManifoldCF, there's a two-tiered classloader hierarchy. Tika runs in the higher class level. Its expectation is that classes that are loaded via reflection use the classloader associated with the class that is resolving the reflection, NOT the thread classloader. That's standard Java practice.

      But apparently there's a place where Tika doesn't do it that way:

      Error tossed: org/apache/poi/POIXMLTextExtractor
      java.lang.NoClassDefFoundError: org/apache/poi/POIXMLTextExtractor
              at org.apache.tika.parser.microsoft.ooxml.OOXMLParser.parse(OOXMLParser.java:106) ~[?:?]
              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.manifoldcf.agents.transformation.tika.TikaParser.parse(TikaParser.java:74) ~[?:?]
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kwright@metacarta.com Karl Wright
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: