NullPointerException on Office Macros

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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

Summary

Problem

Attached office documents cannot be rendered with office macros. The following error returns upon page published.

(Auto-migrated image: description temporarily unavailable)

Diagnosis

Review the latest atlassian-confluence.log. Stack traces do not tell much expect for the NullPointerException.

1 2 3 4 5 6 7 8 9 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:

Solution

Resolution

Make sure Confluence has the necessary permission on both attachments and viewfile directories on the Shared Home directory.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.