Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-7748

Spring bean components in plugins do not get wired onto macros

    • Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Medium Medium
    • None
    • 2.3.1
    • None

      At the moment, if you have this in your atlassian-plugin.xml file:

      <macro name="gmap" class="com.atlassian.confluence.ext.gmaps.GmapsMacro" key="gmap">
      <description>The individual map macro.</description>
      </macro>

      <component name="gmapsManager" class="com.atlassian.confluence.ext.gmaps.GmapsManager" key="gmapsManager"/>

      And GmapsMacro depends on gmapsManager being injected, it will not be.

      Wiring of spring beans declared inside plugins is broken.

            [CONFSERVER-7748] Spring bean components in plugins do not get wired onto macros

            Confluence 2.3 and higher create plugin modules in the order they are declared in the atlassian-plugin.xml file.

            Components required by a macro must be declared above the macro in the plugin's XML descriptor.

            Matt Ryall added a comment - Confluence 2.3 and higher create plugin modules in the order they are declared in the atlassian-plugin.xml file. Components required by a macro must be declared above the macro in the plugin's XML descriptor.

            Is this fix valid for 2.3.3 also. I'm running into the same issue. The google maps plug in is installed, but am receiving an error:

            Error formatting macro: gmap: java.lang.NullPointerException

            Carmen Serafin added a comment - Is this fix valid for 2.3.3 also. I'm running into the same issue. The google maps plug in is installed, but am receiving an error: Error formatting macro: gmap: java.lang.NullPointerException

            If you unpack the jar and modify the atlassian-plugin.xml to have the component element before the macro element, repack and reinstall everything will work.

            Nice plugin!

            Mark McBride added a comment - If you unpack the jar and modify the atlassian-plugin.xml to have the component element before the macro element, repack and reinstall everything will work. Nice plugin!

              Unassigned Unassigned
              dave@atlassian.com dave (Inactive)
              Affected customers:
              4 This affects my team
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: