NullPointerException on Office Macros
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
Attached office documents cannot be rendered with office macros. The following error returns upon page published.
Diagnosis
Review the latest atlassian-confluence.log
. Stack traces do not tell much expect for the NullPointerException.
2019-10-22 14:38:30,834 WARN [http-nio-8090-exec-1] [xhtml.view.macro.ViewMacroMarshaller] handleMacroExecutionException Exception executing macro: viewdoc, with message: java.lang.NullPointerException
-- url: /display/SAN/Test+Page | page: 18120731 | traceId: 71c7d8c2af29ac76 | userName: admin@example.com | referer: https://confluence.test.com/display/SAN/Test+Page | action: viewpage
2019-10-22 14:38:53,031 WARN [http-nio-8090-exec-2] [xhtml.view.macro.ViewMacroMarshaller] handleMacroExecutionException Exception executing macro: viewxls, with message: java.lang.NullPointerException
-- url: /display/SAN/Test+Page2 | page: 13271625 | traceId: 0be794c900c728fa | userName: admin@example.com | referer: https://confluence.test.com/display/SAN/Test+Page2 | action: viewpage
2019-10-22 14:38:53,031 WARN [http-nio-8090-exec-3] [xhtml.view.macro.ViewMacroMarshaller] handleMacroExecutionException Exception executing macro: viewppt, with message: java.lang.NullPointerException
-- url: /display/SAN/Test+Page3 | page: 13271688 | traceId: 0be794c900c728fa | userName: admin@example.com | referer: https://confluence.test.com/display/SAN/Test+Page3 | action: viewpage
Cause
Confluence does not have sufficient permission to access the viewfile
directory on Shared Home directory.
viewfile
directory location:
- Confluence Server:
<Confluence-Home>/shared-home/viewfile
- Confluence Data Center:
<Shared-Home>/viewfile
Resolution
Make sure Confluence has the necessary permission on both attachments
and viewfile
directories on the Shared Home directory.