UnsatisfiedDependencyException - Error creating bean with name
Symptom: "UnsatisfiedDependencyException: Error creating bean with name", "Unsatisfied dependency expressed through constructor argument with index 1"
Cause: the class is unknown to the OSGI plugin
Solution: add a
component-import element in the
atlassian-plugin.xml file to import the necessary class. See the Component Import plugin module for an example of what this element does.
Note that the first argument to the constructor has index 0, not index 1.
Add this to
atlassian-plugin.xml so that the plugin knows about the missing class:
A good rule of thumb is to be careful with any class whose package doesn't start with
component-import may not always work if the host application exposes more than one bean under the same interface. The safest way is to use Constructor Injection is in combination with
@Qualifier Spring annotation. See the Plugin Framework documentation for information on how to use
@Qualifier to avoid ambiguity in your constructor.
If using a
component-import doesn't work you may be able to instantiate the object using
ComponentManager.getInstance().getMyObject(), or even