java.lang.NullPointerException

Sakai JIRA | Tim Donohue | 2 years ago
  1. 0

    Media Filter

    Google Groups | 9 months ago | Róbert Bodnár
    java.lang.NullPointerException
  2. 0

    In DSpace 4.2, if you attempt to extract the text from PDFs which do NOT have embedded fonts, you will see a NullPointerException from PDFBox 1.6.0 (which is the version we use). It looks similar to this: ERROR filtering, skipping bitstream: Item Handle: [prefix]/[suffix] Bundle Name: ORIGINAL File Size: [size] Checksum: [checksum] (MD5) Asset Store: 0 java.lang.NullPointerException java.lang.NullPointerException at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:100) at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:75) at org.apache.pdfbox.pdmodel.PDResources.getFonts(PDResources.java:115) at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:243) at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:225) at org.apache.pdfbox.util.PDFTextStripper.processPage(PDFTextStripper.java:442) at org.apache.pdfbox.util.PDFTextStripper.processPages(PDFTextStripper.java:366) at org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:322) at org.dspace.app.mediafilter.PDFFilter.getDestinationStream(PDFFilter.java:101) at org.dspace.app.mediafilter.MediaFilterManager.processBitstream(MediaFilterManager.java:737) at org.dspace.app.mediafilter.MediaFilterManager.filterBitstream(MediaFilterManager.java:561) at org.dspace.app.mediafilter.MediaFilterManager.filterItem(MediaFilterManager.java:511) at org.dspace.app.mediafilter.MediaFilterManager.applyFiltersItem(MediaFilterManager.java:479) at org.dspace.app.mediafilter.MediaFilterManager.applyFiltersAllItems(MediaFilterManager.java:414) at org.dspace.app.mediafilter.MediaFilterManager.main(MediaFilterManager.java:333) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:225) at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:77) As best as I can tell, this seems to be related to this bug in PDFBox: https://issues.apache.org/jira/browse/PDFBOX-1988 This bug was resolved in PDFBox version 1.8.5 and 2.0.0. I'd suggest we upgrade our version of PDFBox to minimally 1.8.5 in order to resolve this issue.

    Sakai JIRA | 2 years ago | Tim Donohue
    java.lang.NullPointerException
  3. 0

    In DSpace 4.2, if you attempt to extract the text from PDFs which do NOT have embedded fonts, you will see a NullPointerException from PDFBox 1.6.0 (which is the version we use). It looks similar to this: ERROR filtering, skipping bitstream: Item Handle: [prefix]/[suffix] Bundle Name: ORIGINAL File Size: [size] Checksum: [checksum] (MD5) Asset Store: 0 java.lang.NullPointerException java.lang.NullPointerException at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:100) at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:75) at org.apache.pdfbox.pdmodel.PDResources.getFonts(PDResources.java:115) at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:243) at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:225) at org.apache.pdfbox.util.PDFTextStripper.processPage(PDFTextStripper.java:442) at org.apache.pdfbox.util.PDFTextStripper.processPages(PDFTextStripper.java:366) at org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:322) at org.dspace.app.mediafilter.PDFFilter.getDestinationStream(PDFFilter.java:101) at org.dspace.app.mediafilter.MediaFilterManager.processBitstream(MediaFilterManager.java:737) at org.dspace.app.mediafilter.MediaFilterManager.filterBitstream(MediaFilterManager.java:561) at org.dspace.app.mediafilter.MediaFilterManager.filterItem(MediaFilterManager.java:511) at org.dspace.app.mediafilter.MediaFilterManager.applyFiltersItem(MediaFilterManager.java:479) at org.dspace.app.mediafilter.MediaFilterManager.applyFiltersAllItems(MediaFilterManager.java:414) at org.dspace.app.mediafilter.MediaFilterManager.main(MediaFilterManager.java:333) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:225) at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:77) As best as I can tell, this seems to be related to this bug in PDFBox: https://issues.apache.org/jira/browse/PDFBOX-1988 This bug was resolved in PDFBox version 1.8.5 and 2.0.0. I'd suggest we upgrade our version of PDFBox to minimally 1.8.5 in order to resolve this issue.

    Sakai JIRA | 2 years ago | Tim Donohue
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont()
    2. Apache PDFBox
      PDFTextStripper.writeText
      1. org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:100)
      2. org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:75)
      3. org.apache.pdfbox.pdmodel.PDResources.getFonts(PDResources.java:115)
      4. org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:243)
      5. org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:225)
      6. org.apache.pdfbox.util.PDFTextStripper.processPage(PDFTextStripper.java:442)
      7. org.apache.pdfbox.util.PDFTextStripper.processPages(PDFTextStripper.java:366)
      8. org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:322)
      8 frames
    3. DSpace Kernel :: API and Implementation
      MediaFilterManager.main
      1. org.dspace.app.mediafilter.PDFFilter.getDestinationStream(PDFFilter.java:101)
      2. org.dspace.app.mediafilter.MediaFilterManager.processBitstream(MediaFilterManager.java:737)
      3. org.dspace.app.mediafilter.MediaFilterManager.filterBitstream(MediaFilterManager.java:561)
      4. org.dspace.app.mediafilter.MediaFilterManager.filterItem(MediaFilterManager.java:511)
      5. org.dspace.app.mediafilter.MediaFilterManager.applyFiltersItem(MediaFilterManager.java:479)
      6. org.dspace.app.mediafilter.MediaFilterManager.applyFiltersAllItems(MediaFilterManager.java:414)
      7. org.dspace.app.mediafilter.MediaFilterManager.main(MediaFilterManager.java:333)
      7 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames
    5. DSpace Kernel :: API and Implementation
      ScriptLauncher.main
      1. org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:225)
      2. org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:77)
      2 frames