User macro place-holder fails to load due to image not being publicly accessible
Problem
When inserting a user macro in the editor, the user macro place-holder would not load, and the page editor becomes unresponsive. The following stack trace can be seen in the logs:
The following appears in the atlassian-confluence.log
:
java.lang.NullPointerException
at com.atlassian.confluence.tinymceplugin.placeholder.DefaultPlaceholderImageFactory.getIcon(DefaultPlaceholderImageFactory.java:188)
at com.atlassian.confluence.tinymceplugin.placeholder.DefaultPlaceholderImageFactory.getPlaceholderImage(DefaultPlaceholderImageFactory.java:72)
at com.atlassian.confluence.tinymceplugin.placeholder.MacroPlaceholderServlet.getPlaceholderImage(MacroPlaceholderServlet.java:130)
at com.atlassian.confluence.tinymceplugin.placeholder.MacroPlaceholderServlet.doGet(MacroPlaceholderServlet.java:101)
Cause
The most plausible reason for this is that the image defined as the user macro's icon URL is not publicly accessible by the TinyMCE Plugin. This has been tracked as an improvement request here: - CONF-24857Getting issue details... STATUS
Resolution
There are two workarounds that can be used to overcome this:
Image Within Confluence
- Create a new directory inside
CONFLUENCE_INSTALL/confluence/images
. - Place the image for the icon inside the created directory.
- Access Confluence's User Macro settings via
Browse > Confluence Admin > User Macros
. Under Icon URL for the user macro, enter a relative path to the image as per directory created in step two (2) above. For example:
/images/user_macro_icons/test.jpg
- Save the user macro.
- Now you can insert the user macro into any page/space/blog and the user macro place-holder would load.
Image in a Public Domain/Storage
- Place the image for the icon inside a public domain/storage (e.g. Dropbox).
- Access Confluence's User Macro settings via
Browse > Confluence Admin > User Macros
. Under Icon URL for the user macro, enter the absolute URL to the image as copied in step one (1) above. For example:
http://dl.dropbox.com/u/3233473/test.jpg
- Save the user macro.
Now you can insert the user macro to any page/space/blog and the user macro place-holder would load.
If the issue does not resolve itself, try to clear the following:
- Clear the Confluence cache:
Browse > Confluence Admin > Cache Statistics > Flush all
- Clear your browser cache and cookies.