org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.atlassian.jira.bc.issue.comment.CommentService] is defined: Unsatisfied dependency of type [interface com.atlassian.jira.bc.issue.comment.CommentService]: expected at least 1 matching bean

Atlassian JIRA | Bjarni Thorbjornsson | 5 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When a plugin developer creates a webwork action with the same name as a JIRA webwork the autowiring fails. Here is a "DeleteWorklog" webwork that we have defined in our plugin: {code} <webwork1 key="DeleteWorklogWebWork" name="Tempo Delete Worklog Action"> <actions> <action name="com.tempoplugin.worklog.action.DeleteWorklog" alias="TempoDeleteWorklog"> ... </action> </actions> </webwork1> {code} This works fine in our plugin and our alias works fine but when the user tries to use the standard "DeleteWorklog" action on the "Work Log" tab she gets this error: {code} [INFO] [talledLocalContainer] 2011-11-16 10:20:12,003 http-2990-13 ERROR bjarnit 620x2957x1 blsvr7 10.41.105.159 /secure/DeleteWorklog!default.jspa [jira.config.webwork.JiraActionFactory] Error autowiring Action 'com.atlassian.jira.web.action.issue.DeleteWorklog'. [INFO] [talledLocalContainer] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.atlassian.jira.web.action.issue.DeleteWorklog': Unsatisfied dependency expressed through constructor argument with index 1 of type [com.atlassian.jira.bc.issue.comment.CommentService]: : No unique bean of type [com.atlassian.jira.bc.issue.comment.CommentService] is defined: Unsatisfied dependency of type [interface com.atlassian.jira.bc.issue.comment.CommentService]: expected at least 1 matching bean; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.atlassian.jira.bc.issue.comment.CommentService] is defined: Unsatisfied dependency of type [interface com.atlassian.jira.bc.issue.comment.CommentService]: expected at least 1 matching bean [INFO] [talledLocalContainer] at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:591) [INFO] [talledLocalContainer] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:193) [INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925) [INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835) {code} Also note that we have seen similar behavior with resources. When two plugins installed at the same instance both define *i18n.properties* as the resource one resource seems to be overwritten by the other meaning that one plugin is not localized! The workaround that we are practicing is to simply prefix all webworks classes (like "TempoDeleteWorklog.java") but you can't expect every plugin vendor to do that! Best regards, -Bjarni, Tempo team

    Atlassian JIRA | 5 years ago | Bjarni Thorbjornsson
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.atlassian.jira.bc.issue.comment.CommentService] is defined: Unsatisfied dependency of type [interface com.atlassian.jira.bc.issue.comment.CommentService]: expected at least 1 matching bean
  2. 0

    When a plugin developer creates a webwork action with the same name as a JIRA webwork the autowiring fails. Here is a "DeleteWorklog" webwork that we have defined in our plugin: {code} <webwork1 key="DeleteWorklogWebWork" name="Tempo Delete Worklog Action"> <actions> <action name="com.tempoplugin.worklog.action.DeleteWorklog" alias="TempoDeleteWorklog"> ... </action> </actions> </webwork1> {code} This works fine in our plugin and our alias works fine but when the user tries to use the standard "DeleteWorklog" action on the "Work Log" tab she gets this error: {code} [INFO] [talledLocalContainer] 2011-11-16 10:20:12,003 http-2990-13 ERROR bjarnit 620x2957x1 blsvr7 10.41.105.159 /secure/DeleteWorklog!default.jspa [jira.config.webwork.JiraActionFactory] Error autowiring Action 'com.atlassian.jira.web.action.issue.DeleteWorklog'. [INFO] [talledLocalContainer] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.atlassian.jira.web.action.issue.DeleteWorklog': Unsatisfied dependency expressed through constructor argument with index 1 of type [com.atlassian.jira.bc.issue.comment.CommentService]: : No unique bean of type [com.atlassian.jira.bc.issue.comment.CommentService] is defined: Unsatisfied dependency of type [interface com.atlassian.jira.bc.issue.comment.CommentService]: expected at least 1 matching bean; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.atlassian.jira.bc.issue.comment.CommentService] is defined: Unsatisfied dependency of type [interface com.atlassian.jira.bc.issue.comment.CommentService]: expected at least 1 matching bean [INFO] [talledLocalContainer] at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:591) [INFO] [talledLocalContainer] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:193) [INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925) [INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835) {code} Also note that we have seen similar behavior with resources. When two plugins installed at the same instance both define *i18n.properties* as the resource one resource seems to be overwritten by the other meaning that one plugin is not localized! The workaround that we are practicing is to simply prefix all webworks classes (like "TempoDeleteWorklog.java") but you can't expect every plugin vendor to do that! Best regards, -Bjarni, Tempo team

    Atlassian JIRA | 5 years ago | Bjarni Thorbjornsson
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.atlassian.jira.bc.issue.comment.CommentService] is defined: Unsatisfied dependency of type [interface com.atlassian.jira.bc.issue.comment.CommentService]: expected at least 1 matching bean

    Root Cause Analysis

    1. org.springframework.beans.factory.NoSuchBeanDefinitionException

      No unique bean of type [com.atlassian.jira.bc.issue.comment.CommentService] is defined: Unsatisfied dependency of type [interface com.atlassian.jira.bc.issue.comment.CommentService]: expected at least 1 matching bean

      at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray()
    2. Spring Beans
      AbstractAutowireCapableBeanFactory.createBeanInstance
      1. org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:591)
      2. org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:193)
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
      4 frames