Rate this page:
Cause: the class is unknown to the OSGI plugin
Solution: add a element in the file to import the necessary class. See the Component Import plugin module for an example of what this element does.
1 2 3 4 5 6 7 8 9 10 11
2010-02-23 14:15:46,831 http-8080-Processor25 ERROR admin 51345x1x1 1hageqe http://localhost:8080/rest/example/1.0/myplugin [atlassian.plugin.servlet.DefaultServletModuleManager] Unable to create filter com.atlassian.plugin.servlet.util.LazyLoadedReference$InitializationException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.example.jira.plugins.MyPlugin': Unsatisfied dependency expressed through constructor argument with index 1 of type [com.atlassian.sal.api.user.UserManager]: : No unique bean of type [com.atlassian.sal.api.user.UserManager] is defined: Unsatisfied dependency of type [interface com.atlassian.sal.api.user.UserManager]: expected at least 1 matching bean; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.atlassian.sal.api.user.UserManager] is defined: Unsatisfied dependency of type [interface com.atlassian.sal.api.user.UserManager]: expected at least 1 matching bean at com.atlassian.plugin.servlet.util.LazyLoadedReference.get(LazyLoadedReference.java:94) ...
Note that the first argument to the constructor has index 0, not index 1.
Add this to so that the plugin knows about the missing class:
<component-import key="userManager" interface="com.atlassian.sal.api.user.UserManager"/>
A good rule of thumb is to be careful with any class whose package doesn't start with
Note that 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 Spring annotation. See the Plugin Framework documentation for information on how to use to avoid ambiguity in your constructor.
If using a doesn't work you may be able to instantiate the object using
or , or even .
Rate this page: