This happens when you try to insert another object of your plugin on the object of your plugin, and you do it as if the other object was another plugin and was exported as a public OSGi service.
In JIRA, you can declare your Java plugin classes as components. This means that instantiation and nesting of dependencies (for example, through the constructor) will be automatically delegated to the Spring Framework, which is part of the JIRA. Usually we do this to lose concern for the assets and dependencies of classes. There are two types of components: open and closed. Public components will be available for import for different plugins than yours. Other plugins can import them and then use them through dependency injection. Private components will work just like regular components, but other plugins will not be able to import or see them.
If you have one component, say A , which depends on another component, B , both of them are part of your plugin, you should not import component B , which will be available for A , because it is already part of your plugin. Before JIRA 7, to import the component that you placed in the atlassian-plugin.xml a <component-import> element. JIRA 7, you add @ComponentImport in front of the constructor parameter when you do dependency injection through the constructor.
So, I think that you were mistaken, it is to put <component-import> on the component that comes directly from your plugin, and not <component> . Or, if you have JIRA 7 or later, which you did wrong, you had to put @ComponentImport in front of the component of your own plugin, and the solution would be to remove this annotation. At least this last one was my business and by removing these annotations from the dependencies of the component injections coming from the same plugin, I made it work.
source share