User macro place-holder fails to load due to image not being publicly accessible

Still need help?

The Atlassian Community is here for you.

Ask the community

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-24857 - Getting issue details... STATUS

Resolution

There are two workarounds that can be used to overcome this:

Image Within Confluence

  1. Create a new directory inside CONFLUENCE_INSTALL/confluence/images.
  2. Place the image for the icon inside the created directory.
  3. Access Confluence's User Macro settings via Browse > Confluence Admin > User Macros.
  4. 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
    

  5. Save the user macro.
  6. 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

  1. Place the image for the icon inside a public domain/storage (e.g. Dropbox).
  2. Access Confluence's User Macro settings via Browse > Confluence Admin > User Macros.
  3. 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
    

  4. Save the user macro.
  5. Now you can insert the user macro to any page/space/blog and the user macro place-holder would load.

(info)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.

















Last modified on Apr 28, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.