Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-23086

DefaultComponentClassManager does not find the plugin that can autowire a given class name correctly

    XMLWordPrintable

Details

    Description

      DefaultComponentClassManager's newInstance(className) currently instantiates and autowires an instance of the given class name with the follow steps

      1. Load the class using JIRA's non-OSGi classloader, and if found, autowire via Pico container
      2. Ask plugin system's PluginsClassLoader to load the given class.
      3. Then ask PluginsClassLoader which plugin was able to load the class (PluginsClassLoader will return the first plugin that it finds able to load the class)
      4. Ask the found plugin to instantiate and autowire an instance of the class (Note that the plugin is wrapped within an AbstractDelegatingPlugin, which implements AutowireCapablePlugin, so it will always go to the option to cast it to AutowireCapablePlugin and autowire it).

      However, the plugins that can load the class are not necessary the plugin that exports the class and is able to autowire it, such as:

      • another plugin that happens to statically import the package of the given class
      • any OSGi bundle that has DynamicImport-Package to import a wide range of packages including that of the given class. In our case, the OSGi Compendium bundle, which has the header "DynamicImport-Package: *"

      Attachments

        Activity

          People

            pleschev Peter Leschev
            awei Alex Wei (DE)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: