struts.multipart.saveDir property has not been defined error when saving
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
Summary
When saving a page the following error results:
ERROR [http-nio-8090-exec-7] [xhtml.view.macro.ViewMacroMarshaller] handleMacroExecutionException Error rendering macro: view-file
xxxxxxxxx | userName: username | action: viewpage | url: /pages/viewpage.action
java.lang.IllegalStateException: struts.multipart.saveDir property has not been defined
Environment
Confluence 8.x.x
Diagnosis
The confluence.cfg.xml file contains an entry for webwork.multipart.saveDir in 8.x.x.
Cause
For Confluence version > 8, In the confluence.cfg.xml file webwork.multipart.saveDir has been replaced with struts.multipart.saveDir. This will be done automatically when an upgrade to version > = 8 is performed, but sometimes if the upgrade task fails then it will not have changed automatically.
Solution
- Check in each of the Confluence nodes the file confluence.cfg.xml in the home directory
- If the file is missing the property struts.multipart.saveDir
- Stop Confluence on the node
- Add the following line to confluence.cfg.xml
<property name="struts.multipart.saveDir">${localHome}/temp</property>
- Restart the Confluence node