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

Using PackageParser in ForkParser causes NPE

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.16
    • Fix Version/s: None
    • Component/s: parser
    • Labels:
      None

      Description

      Caused by: java.lang.NullPointerException
      at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:158)
      at org.apache.tika.mime.MimeTypes.getDefaultMimeTypes(MimeTypes.java:577)
      at org.apache.tika.config.TikaConfig.getDefaultMimeTypes(TikaConfig.java:78)
      at org.apache.tika.config.TikaConfig.<init>(TikaConfig.java:242)
      at org.apache.tika.config.TikaConfig.getDefaultConfig(TikaConfig.java:379)
      at org.apache.tika.parser.pkg.PackageParser.parse(PackageParser.java:165)
      at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)

      The mediaTypeRegistry handling code in parse() of PackageParser seems cause the problem due to ForkParser cannot properly construct default TikaConfig. Also since TikaConfig is not serializable, there is no way to assign mediaTypeRegistry/bufferedMediaTypeRegistry before calling parse()

        Issue Links

          Activity

          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build Tika-trunk #1391 (See https://builds.apache.org/job/Tika-trunk/1391/)
          TIKA-2483 – revert loading of mime repository in PackageParser from (tallison: https://github.com/apache/tika/commit/06486c8548daf5f9ba588da4e88e3da82a429e70)

          • (edit) tika-parsers/src/main/java/org/apache/tika/parser/pkg/PackageParser.java
          • (edit) tika-parsers/src/test/java/org/apache/tika/parser/fork/ForkParserIntegrationTest.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Tika-trunk #1391 (See https://builds.apache.org/job/Tika-trunk/1391/ ) TIKA-2483 – revert loading of mime repository in PackageParser from (tallison: https://github.com/apache/tika/commit/06486c8548daf5f9ba588da4e88e3da82a429e70 ) (edit) tika-parsers/src/main/java/org/apache/tika/parser/pkg/PackageParser.java (edit) tika-parsers/src/test/java/org/apache/tika/parser/fork/ForkParserIntegrationTest.java
          Hide
          chikei TzeKai Lee added a comment -

          this should produce the NPE

          Show
          chikei TzeKai Lee added a comment - this should produce the NPE
          Hide
          gagravarr Nick Burch added a comment -

          Are you able to put together a small snippet of code (ideally a junit unit test case, but anything we can run will do) that shows how to reproduce the issue? Someone can then take a look and ponder the right fix

          Show
          gagravarr Nick Burch added a comment - Are you able to put together a small snippet of code (ideally a junit unit test case, but anything we can run will do) that shows how to reproduce the issue? Someone can then take a look and ponder the right fix

            People

            • Assignee:
              Unassigned
              Reporter:
              chikei TzeKai Lee
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Development