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

tika-config.xml does not provide a way to set ServiceLoader to dynamic

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7, 1.8, 1.9, 1.10
    • Fix Version/s: 1.10
    • Component/s: core
    • Labels:
      None
    • Environment:

      OSGi

    • Flags:
      Patch

      Description

      Currently if you create a TikaConfig from a file (ex tika-config.xml). There is no way to specify that you want to use a ServiceLoader with dynamic set. Prior to tika 1.7 this was not an issue since the during the tika-config.xml parse Tika would instantiate parsers using the default constructor which in turn would instantiate a new ServiceLoader. The default ServiceLoader constructor sets dynamic to true which allows dynamic loading of parsers.

      Changes to TikaConfig now cause the tika-config.xml parse to call a constructor which passes the ServiceLoader to be passed as a parameter. This ServiceLoader is always constructed with a Classloader which will cause dynamic to always be set to false. This breaks Tika in OSGi environments which depend on dynamic being set to true (for example Apache Sling).

      I'm proposing adding an xml attribute to the parser element to instantiate the parser with dynamic set to true. This allows users of tika-config.xml to determine how they want parsers loaded.

        Attachments

        1. TIKA-1700B.patch
          7 kB
          Bob Paulin
        2. TIKA-1700A.patch
          6 kB
          Bob Paulin
        3. TIKA-1700.patch
          6 kB
          Bob Paulin

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                bobpaulin Bob Paulin
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: