I am unable to export a space as a PDF

I am trying to export a space as a PDF.
The export process starts, then the following error occurs: "Ha fallito durante l'esportazione a PDF. Messaggio di eccezione - java.lang.NullPointerException", in English: "It has failed during the PDF export. Exception message: java.lang.NullPointerException ".



2 answers

0 votes
Ann Worley Atlassian Team Oct 17, 2017

Hi Francesco.

I understand a null pointer exception error is seen in the browser when you export a space to PDF. This has been seen in the past due to third party plugins that render ok but don't export well. If you can post the rest of the stack trace it may give us an idea which plugin. 

The Tracking Plugin has been known to cause a similar issue:NullPointerException exporting a page or space to PDF due to Tracking-Table Macro

I look forward to hearing what you find.



Hi Ann, thank you for your reply.
My issue is that I am unable to view the stack trace for this exception. I took a look at the Catalina log files, but I can't see this exception (while I can see the trace of other unrelated exception). I also tried to increase the log verbosity using the Administrative panel Confluence offer me (i haven't tried to increase the Log4J verbosity directly).

Can you point me where this trace is?

Thank you for your support
Best regards

The errors should be going into the application log - look in system information to see where that is (the default is a set of files in <confluence home>/logs/ )

Hi Nick, thanks for your reply.
I've done a text search in the logs directory for the word "NullPointerException" without any luck

Ann Worley Atlassian Team Oct 20, 2017

For testing troubleshooting purposes, please try Disabling or enabling all add-ons (using Safe Mode) and export the space to PDF while in safe mode. Note: Any macros that depend on user installed plugins will be disabled while the instance is in safe mode so you will want to do it during off hours or a maintenance window.

If the export works in safe mode, then you can re-enable the add-ons one by one until the export breaks, in order to see which one is causing the issue.

Hi Ann. I just tried what you suggest, but I get the same error as before. If it can help you, I don't have any plugin installed. I just use the default Confluence installation

Hi Ann, if it can help you, i just found the Confluence dir. It was under /var even if in the settings i specified to save them in the confluence home /log. Anyway, here there are (i replaced my real domain with http://host)


I just removed all Jira tasks from the space. Now i am able to export a single page in PDF. If i try to export the whole space, the NullPointerException comes again, this time with a different trace.
Here you can find it


It does help! Thank you very much for the log. It looks like Jira issues macros are causing the null pointer exception during PDF exports:

2017-10-23 20:01:20,899 ERROR [Long running task: PDF Space Export] [xhtml.view.macro.ViewMacroMarshaller] handleMacroExecutionException Error rendering macro: jira
-- url: /spaces/flyingpdf/doflyingpdf.action | referer: http://host:8090/spaces/flyingpdf/flyingpdf.action?key=SPED | traceId: 78afd2847c7b36c8 | userName: f.marcaccio | action: doflyingpdf

Please let me know if the Jira issues macros are displaying on the pages as expected before the export. (I am looking for reasons why the PDF export cannot render those macros.)

I found some bug reports with Jira issues and PDF exports, but none that really match our case, so I am optimistic that we are not running into a bug.

Edit - Our comments crossed, I will look at the new log now.

0 votes
Ann Worley Atlassian Team Oct 23, 2017

So the error this time is:

RuntimeException error occurred while performing an XHTML storage transformation

I found an article that says something like this can be caused by running Java 1.8 on MS Windows server 2003: RuntimeException error occurred while performing an XHTML storage transformation

Does this apply to your instance?

Unfortunately not. I am running Java 8 on a Linux server. The distribution is Centos version 7

Ann Worley Atlassian Team Oct 23, 2017

So that we can take a closer look, I created a support ticket using the email address you are using for Community. You will receive a confirmation email from atlassian.com with your ticket details within the next few minutes. When the issue has been resolved we can circle back to let the Community know what the fix is.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Tuesday in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

251 views 2 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you