Better exception handling for pdf export

XMLWordPrintable

    • 2

      NOTE: This suggestion is for Confluence Cloud. Using Confluence Server? See the corresponding suggestion.

      Background
      User is not able to complete the PDF export and the below error is found in the logs

      com.atlassian.confluence.importexport.ImportExportException: Exception thrown while rendering the page 'no title found' to the PDF document /media/data0/confluence-home/temp/pdfexport-20150518-180515-1654-11/km-180515-1654-12.pdf
              at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:94)
              at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerPdfExporterService.createPdfForSpace(FlyingSaucerPdfExporterService.java:60)
              at com.atlassian.confluence.extra.flyingpdf.PdfExportLongRunningTask$1.doInTransactionWithoutResult(PdfExportLongRunningTask.java:72)
              at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
              at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
              at com.atlassian.confluence.extra.flyingpdf.PdfExportLongRunningTask.runInternal(PdfExportLongRunningTask.java:52)
              at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:27)
              at com.atlassian.confluence.util.longrunning.ManagedTask.run(ManagedTask.java:58)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
              at java.util.concurrent.FutureTask.run(FutureTask.java:262)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NullPointerException
              at com.atlassian.confluence.extra.flyingpdf.ConfluenceExportUserAgent.resolveAndOpenStream(ConfluenceExportUserAgent.java:112)
              at org.xhtmlrenderer.swing.NaiveUserAgent.getBinaryResource(NaiveUserAgent.java:223)
              at org.xhtmlrenderer.pdf.ITextFontResolver.importFontFaces(ITextFontResolver.java:97)
              at org.xhtmlrenderer.pdf.ITextRenderer.setDocument(ITextRenderer.java:178)
              at org.xhtmlrenderer.pdf.ITextRenderer.setDocument(ITextRenderer.java:142)
              at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:74)
              ... 12 more
      

      Expectation

      1. Better logging so we can identify the page that is causing this
      2. Handle the NullPointerException so that the export does not fail completely i.e. the export completes without pages causing this exception.

            Assignee:
            Unassigned
            Reporter:
            Mizan Ali Sayed (Inactive)
            Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: