Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-59038

PDF macro doesn't load PDF content and returns an NPE on SlidePageConversionData

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • High
    • 7.1.1, 7.2.0
    • 7.0.2, 7.0.3, 7.0.4, 7.1.0
    • Macros - Other Macros
    • None

    Description

      Issue Summary

      When users insert PDF macro on a page, the macro does not show the content of the PDF. Instead, the following error is returned:

      There was a problem converting this attachment

      Steps to Reproduce

      1. Head over to a Confluence page.
      2. Add a PDF attachment to the page.
      3. In the Edit mode of the page, head over to the toolbar > Insert > Other Macros > PDF and Insert the macro to the page.

      Expected Results

      The PDF macro will display the PDF on the page.

      Actual Results

      An infinite spinning wheel will be displayed and the following error is returned:

      There was a problem converting this attachment
      

      The following stack trace appears in the logs:

      Caused by: java.lang.NullPointerException
      	at com.benryan.conversion.SlidePageConversionData.<init>(SlidePageConversionData.java:23)
      

      If you are not affected by the error message above but seeing a similar symptom, see also: CONFSERVER-59334 - PDF macro doesn't load PDF content and returns an NPE on readTrailer15 method

      Example:

      2019-10-29 16:21:17,801 ERROR [DefaultSlideCacheManager:thread-1] [com.benryan.conversion.AbstractSlideConversionTask] call problem while converting sample.pdf
       -- referer: http://localhost:8090/display/ZZ/eddd | url: /plugins/servlet/pptslide | traceId: ef1f71c974478e3b | userName: admin
      java.io.IOException: java.lang.NullPointerException
      	at com.benryan.conversion.PdfSlideConversionBatchTask.convertFile(PdfSlideConversionBatchTask.java:56)
      	at com.benryan.conversion.PdfSlideConversionBatchTask.convertFile(PdfSlideConversionBatchTask.java:23)
      	at com.benryan.conversion.AbstractSlideConversionTask.call(AbstractSlideConversionTask.java:40)
      	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at java.base/java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.NullPointerException
      	at com.benryan.conversion.SlidePageConversionData.<init>(SlidePageConversionData.java:23)
      	at com.benryan.conversion.PdfSlideConversionBatchTask.convertFile(PdfSlideConversionBatchTask.java:52)
      	... 6 more
      

      or

      2019-10-29 16:21:17,801 ERROR [DefaultSlideCacheManager:thread-1] [com.benryan.conversion.AbstractSlideConversionTask] call problem while converting sample.pdf
       -- referer: http://localhost:8090/display/ZZ/eddd | url: /plugins/servlet/pptslide | traceId: ef1f71c974478e3b | userName: admin
      java.io.IOException: java.lang.NullPointerException
      	at com.benryan.conversion.PdfSlideConversionBatchTask.convertFile(PdfSlideConversionBatchTask.java:56)
      	at com.benryan.conversion.PdfSlideConversionBatchTask.convertFile(PdfSlideConversionBatchTask.java:23)
      	at com.benryan.conversion.AbstractSlideConversionTask.call(AbstractSlideConversionTask.java:40)
      	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at java.base/java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.NullPointerException
      	at com.benryan.conversion.SlidePageConversionData.<init>(SlidePageConversionData.java:23)
      	at com.benryan.conversion.PdfSlideConversionBatchTask.convertFile(PdfSlideConversionBatchTask.java:52)
      	... 6 more
      

      Note

      This issue is seen and tested on various PDF files. However, some PDF files are not hit with this issue. At the moment, it is not clear why this is the case.

      Workaround

      At the moment there is no workaround to the issue.

      Attachments

        1. atlassian-confluence.log
          202 kB
        2. pdf-test.pdf
          20 kB
        3. sample.pdf
          3 kB

        Issue Links

          Activity

            People

              glipatov George Lipatov
              afaridi Ahmad Faridi
              Votes:
              15 Vote for this issue
              Watchers:
              40 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: