Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.12
    • Fix Version/s: 1.13
    • Component/s: parser
    • Labels:

      Description

      NPE in OpenDocumentParser when no "meta.xml" file exists

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user fxfixer opened a pull request:

        https://github.com/apache/tika/pull/94

        TIKA-1916: NPE in OpenDocumentParser

        NPE in OpenDocumentParser when no "meta.xml" file exists

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/fxfixer/tika patch-2

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/tika/pull/94.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #94


        commit cb842bc9426e0a7de92eb93ac165f364af51da92
        Author: fxfixer <fxfixer@fx-soft.com>
        Date: 2016-03-31T03:02:42Z

        TIKA-1916: NPE in OpenDocumentParser

        NPE in OpenDocumentParser when no "meta.xml" file exists


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user fxfixer opened a pull request: https://github.com/apache/tika/pull/94 TIKA-1916 : NPE in OpenDocumentParser NPE in OpenDocumentParser when no "meta.xml" file exists You can merge this pull request into a Git repository by running: $ git pull https://github.com/fxfixer/tika patch-2 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tika/pull/94.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #94 commit cb842bc9426e0a7de92eb93ac165f364af51da92 Author: fxfixer <fxfixer@fx-soft.com> Date: 2016-03-31T03:02:42Z TIKA-1916 : NPE in OpenDocumentParser NPE in OpenDocumentParser when no "meta.xml" file exists
        Hide
        tallison@mitre.org Tim Allison added a comment -

        Thank you for opening this issue and submitting a fix. I may have missed it, but would you be able to share a test file? I can dummy one up, but I want to make sure the fix works.

        Show
        tallison@mitre.org Tim Allison added a comment - Thank you for opening this issue and submitting a fix. I may have missed it, but would you be able to share a test file? I can dummy one up, but I want to make sure the fix works.
        Hide
        tallison@mitre.org Tim Allison added a comment - - edited

        To fellow Tika devs – any idea why there is special handling for the meta entry in the ZipFile? It should be handled just fine if we iterate through all entries and send them to handleZipEntry, no? Sorry...Should have checked svn history first: TIKA-1353 is why we do that.

        Also, the NPE was masked in the unit test because we weren't closing the zipstream/zipfile in a finally block, and TempResources couldn't close the test file that triggered the NPE. I'll fix that as well.

        Show
        tallison@mitre.org Tim Allison added a comment - - edited To fellow Tika devs – any idea why there is special handling for the meta entry in the ZipFile? It should be handled just fine if we iterate through all entries and send them to handleZipEntry , no? Sorry...Should have checked svn history first: TIKA-1353 is why we do that. Also, the NPE was masked in the unit test because we weren't closing the zipstream/zipfile in a finally block, and TempResources couldn't close the test file that triggered the NPE. I'll fix that as well.
        Hide
        nicholasc Nick C added a comment -

        Attached is a test file. Nice catch I totally overlooked the closing of the zipfile/stream

        Show
        nicholasc Nick C added a comment - Attached is a test file. Nice catch I totally overlooked the closing of the zipfile/stream
        Hide
        tallison@mitre.org Tim Allison added a comment -

        Interesting. The manifest.xml says that it should contain a meta.xml file, but the rdf version of the manifest doesn't...not that that affects anything we're doing now.

        Will commit fix on Monday. Thank you, again!

        Show
        tallison@mitre.org Tim Allison added a comment - Interesting. The manifest.xml says that it should contain a meta.xml file, but the rdf version of the manifest doesn't...not that that affects anything we're doing now. Will commit fix on Monday. Thank you, again!
        Hide
        nicholasc Nick C added a comment -

        I manually created that one because I didn't have the original file. I'll try and take a look at the original and get more details on how they were created next week.

        No problem it's always nice to contribute to an awesome project.

        Show
        nicholasc Nick C added a comment - I manually created that one because I didn't have the original file. I'll try and take a look at the original and get more details on how they were created next week. No problem it's always nice to contribute to an awesome project.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/tika/pull/94

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tika/pull/94
        Hide
        tallison@mitre.org Tim Allison added a comment -

        Thank you, Nick C!

        Show
        tallison@mitre.org Tim Allison added a comment - Thank you, Nick C !
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in tika-2.x #71 (See https://builds.apache.org/job/tika-2.x/71/)
        TIKA-1916 – thanks to Nick C (fxfixer) for opening the issue, (tallison: rev e68ce5f8e3bc0793eab962f55519e2bdeb8e50dc)

        • tika-test-resources/src/test/resources/test-documents/testODTNoMeta.odt
        • tika-parser-modules/tika-parser-office-module/src/main/java/org/apache/tika/parser/odf/OpenDocumentParser.java
        • tika-parser-modules/tika-parser-office-module/src/test/java/org/apache/tika/parser/odf/ODFParserTest.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in tika-2.x #71 (See https://builds.apache.org/job/tika-2.x/71/ ) TIKA-1916 – thanks to Nick C (fxfixer) for opening the issue, (tallison: rev e68ce5f8e3bc0793eab962f55519e2bdeb8e50dc) tika-test-resources/src/test/resources/test-documents/testODTNoMeta.odt tika-parser-modules/tika-parser-office-module/src/main/java/org/apache/tika/parser/odf/OpenDocumentParser.java tika-parser-modules/tika-parser-office-module/src/test/java/org/apache/tika/parser/odf/ODFParserTest.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in tika-trunk-jdk1.7 #938 (See https://builds.apache.org/job/tika-trunk-jdk1.7/938/)
        TIKA-1916 – Thanks to fxfixer (Nick C) for opening the issue and (tallison: rev 5e170d4373c28a4b520196591c4d94ab8073bfbf)

        • tika-parsers/src/test/java/org/apache/tika/parser/odf/ODFParserTest.java
        • tika-parsers/src/test/resources/test-documents/testODTNoMeta.odt
        • tika-parsers/src/main/java/org/apache/tika/parser/odf/OpenDocumentParser.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in tika-trunk-jdk1.7 #938 (See https://builds.apache.org/job/tika-trunk-jdk1.7/938/ ) TIKA-1916 – Thanks to fxfixer (Nick C) for opening the issue and (tallison: rev 5e170d4373c28a4b520196591c4d94ab8073bfbf) tika-parsers/src/test/java/org/apache/tika/parser/odf/ODFParserTest.java tika-parsers/src/test/resources/test-documents/testODTNoMeta.odt tika-parsers/src/main/java/org/apache/tika/parser/odf/OpenDocumentParser.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in tika-2.x #72 (See https://builds.apache.org/job/tika-2.x/72/)
        TIKA-1916 – thanks to Nick C (fxfixer) for opening the issue, (tallison: rev 7418bebf8a3de1299c07c0a96f9439dce7e8b3a3)

        • CHANGES.txt
        • tika-test-resources/src/test/resources/test-documents/testSqlite3b.db
        • tika-parser-modules/tika-parser-database-module/src/test/java/org/apache/tika/parser/jdbc/SQLite3ParserTest.java
        • tika-parser-modules/tika-parser-database-module/src/main/java/org/apache/tika/parser/jdbc/SQLite3TableReader.java
        • tika-parser-modules/tika-parser-database-module/src/main/java/org/apache/tika/parser/jdbc/JDBCTableReader.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in tika-2.x #72 (See https://builds.apache.org/job/tika-2.x/72/ ) TIKA-1916 – thanks to Nick C (fxfixer) for opening the issue, (tallison: rev 7418bebf8a3de1299c07c0a96f9439dce7e8b3a3) CHANGES.txt tika-test-resources/src/test/resources/test-documents/testSqlite3b.db tika-parser-modules/tika-parser-database-module/src/test/java/org/apache/tika/parser/jdbc/SQLite3ParserTest.java tika-parser-modules/tika-parser-database-module/src/main/java/org/apache/tika/parser/jdbc/SQLite3TableReader.java tika-parser-modules/tika-parser-database-module/src/main/java/org/apache/tika/parser/jdbc/JDBCTableReader.java

          People

          • Assignee:
            tallison@mitre.org Tim Allison
            Reporter:
            nicholasc Nick C
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development