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

NPE thrown by TikaConfig.getDefaultConfig()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 1.4
    • None
    • config
    • None
    • OS-X, JDK 1.7

    Description

      The below exception gets thrown every time I execute TikaConfig.getDefaultConfig. Similary, invoking `Tika t = new Tika()` throws the same exception, since code inside this constructor invokes TikaConfig.getDefaultConfig().

      This problem is non-existent when I use Tika-core and Tika-parsers 1.0. But when bump the version numbers to 1.2 (in order to get around a bug in PDFBOX), the problem shows up. I'm using maven. I've carefully ensured that I'm not pulling in the wrong version of Tika, using things like `mvn dependency:tree` and making there were no sneaky problematic transitive dependencies.

      java.lang.NullPointerException
      at org.apache.tika.mime.MimeTypesReader$ClauseRecord.stop(MimeTypesReader.java:245)
      at org.apache.tika.mime.MimeTypesReader.endElement(MimeTypesReader.java:203)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)
      at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1303)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2717)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
      at org.apache.tika.mime.MimeTypesReader.read(MimeTypesReader.java:115)
      at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:64)
      at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:93)
      at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:149)
      at org.apache.tika.mime.MimeTypes.getDefaultMimeTypes(MimeTypes.java:479)
      at org.apache.tika.config.TikaConfig.getDefaultMimeTypes(TikaConfig.java:60)
      at org.apache.tika.config.TikaConfig.<init>(TikaConfig.java:169)
      at org.apache.tika.config.TikaConfig.getDefaultConfig(TikaConfig.java:268)
      at
      my.method.which.invokes `new Tika()`

      Attachments

        1. TCT.java
          0.4 kB
          Nick Burch

        Activity

          People

            Unassigned Unassigned
            dajohnson89 Derrick Johnson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: