Unable to Remove Attachment Because of Special Characters

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

Symptoms

  • Confluence is running over SSL

  • Unable to remove an attachment

The following appears in the atlassian-confluence.log:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 2014-04-25 07:12:24,735 ERROR [http-172.16.5.144-8442-37] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action -- url: /confluence/json/removeattachmentversion.action | userName: Dfeng | referer: https://confluence.harman.com/confluence/pages/viewpageattachments.action?pageId=33981018 java.lang.NullPointerException at com.atlassian.confluence.pages.AttachmentDownloadPathCache.toKey(AttachmentDownloadPathCache.java:31) at com.atlassian.confluence.pages.CachingAttachmentManager.removeAttachmentVersionFromServer(CachingAttachmentManager.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171
1 2 3 4 fileName : (51job.com)申请贵公司Embedded Software Engineer - Test(成都)-肖军 .htm version : 1 caused by: java.lang.NullPointerException at com.atlassian.confluence.pages.AttachmentDownloadPathCache.toKey(AttachmentDownloadPathCache.java:31)

Cause

The attachment file name contains special characters.

Resolution

  • Shutdown Confluence

  • Open <CONFLUENCE-INSTALLATION-DIRECTORY>/conf/server.xml

  • Edit the file by adding the following in the SSL Connector element:

    1 URIEncoding="UTF-8"
  • Save the file

  • Restart Confluence

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.