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 vote
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.

Thanks,

Ann

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
Francesco

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)

https://pastebin.com/edsMkNgc

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


https://pastebin.com/Tp6C7CBZ

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
java.lang.NullPointerException

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 vote
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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

450 views 21 10
Join discussion

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