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
  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
  3. 0

    ERROR [http-8080-1] servlet.DispatcherServlet.[] Oct/12 16:16:44 - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'additionalParametersController': Autowiring of methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.jasig.portlet.emailpreview.servlet.AdditionalParametersController.setLinkServiceRegistry(org.jasig.portlet.emailpreview.service.link.ILinkServiceRegistry); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.jasig.portlet.emailpreview.service.link.ILinkServiceRegistry] is defined: Unsatisfied dependency of type [interface org.jasig.portlet.emailpreview.service.link.ILinkServiceRegistry]: expected at least 1 matching bean at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:256) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:998) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:662) Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.jasig.portlet.emailpreview.servlet.AdditionalParametersController.setLinkServiceRegistry(org.jasig.portlet.emailpreview.service.link.ILinkServiceRegistry); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.jasig.portlet.emailpreview.service.link.ILinkServiceRegistry] is defined: Unsatisfied dependency of type [interface org.jasig.portlet.emailpreview.service.link.ILinkServiceRegistry]: expected at least 1 matching bean at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:543) at org.springframework.beans.factory.annotation.InjectionMetadata.injectMethods(InjectionMetadata.java:117) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:253) ... 30 more Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.jasig.portlet.emailpreview.service.link.ILinkServiceRegistry] is defined: Unsatisfied dependency of type [interface org.jasig.portlet.emailpreview.service.link.ILinkServiceRegistry]: expected at least 1 matching bean at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:613) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:499) ... 32 more

    Apereo Issues | 5 years ago | Drew Wills
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'additionalParametersController': Autowiring of methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.jasig.portlet.emailpreview.servlet.AdditionalParametersController.setLinkServiceRegistry(org.jasig.portlet.emailpreview.service.link.ILinkServiceRegistry); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.jasig.portlet.emailpreview.service.link.ILinkServiceRegistry] is defined: Unsatisfied dependency of type [interface org.jasig.portlet.emailpreview.service.link.ILinkServiceRegistry]: expected at least 1 matching bean
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Reserved word

    Google Groups | 6 years ago | Shamsul Kamal
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.helloworldweb.milkyway.serviceapi.PlanetService] is defined: Unsatisfied dependency of type [interface org.helloworldweb.milkyway.serviceapi.PlanetService]: expected at least 1 matching bean
  6. 0

    UnsatisfiedDependencyException - Error creating bean with name - Atlassian Developers

    atlassian.com | 4 months ago
    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

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    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