Images not showing in Confluence due to corrupt or missing web.xml
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
Problem
Confluence does not display images as expected.
The following appears in the atlassian-confluence.log
1
2
3
2017-08-18 13:09:17,660 ERROR [http-nio-8090-exec-6] [[Standalone].[localhost].[/Context_path].[noop]] log Servlet.service() for servlet [noop] in context with path [/Context_path] threw exception
java.lang.NullPointerException
at com.atlassian.confluence.servlet.rewrite.CachedRewriteMatch.execute(CachedRewriteMatch.java:32)
Cause
The web.xml file that Tomcat uses is not supplying the necessary settings to display static content.
ℹ️ The web.xml file referred to in this article is <confluence_install>/conf/web.xml and not <confluence_install>/confluence/WEB-INF/web.xml
Resolution
Download a Confluence archive (.zip or .tar.gz) of the version you are running and extract the web.xml file from the conf directory.
Backup your existing web.xml and copy the file from the archive to your <confluence_install>/conf directory
Restart Confluence to pick up the change.
Was this helpful?