org.springframework.beans.factory.BeanCreationException

Error creating bean with name 'org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.jmx.export.MBeanExporter org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration.mbeanExporter; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [org.springframework.jmx.export.MBeanExporter] is defined: more than one 'primary' bean found among candidates: [mbeanExporter, integrationMbeanExporter, endpointMBeanExporter]

Solutions on the web19459

  • org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [org.springframework.jmx.export.MBeanExporter] is defined: more than one 'primary' bean found among candidates: [mbeanExporter, integrationMbeanExporter, endpointMBeanExporter]
  • org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [org.springframework.jmx.export.MBeanExporter] is defined: more than one 'primary' bean found among candidates: [mbeanExporter, integrationMbeanExporter, endpointMBeanExporter]
  • : No qualifying bean of type [org.springframework.jmx.export.MBeanExporter] is defined: expected single matching bean but found 2: mbeanExporter,endpointMBeanExporter
  • Stack trace

    • org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.jmx.export.MBeanExporter org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration.mbeanExporter; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [org.springframework.jmx.export.MBeanExporter] is defined: more than one 'primary' bean found among candidates: [mbeanExporter, integrationMbeanExporter, endpointMBeanExporter] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)[spring-context-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)[spring-context-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)[spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:760)[spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE] at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:360)[spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:306)[spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)[spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)[spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE] at com.xdidian.keryhu.user_account.Application.main(Application.java:15)[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_40] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_40] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_40] at java.lang.reflect.Method.invoke(Method.java:497)[na:1.8.0_40] at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)[spring-boot-devtools-1.3.6.RELEASE.jar:1.3.6.RELEASE] Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.jmx.export.MBeanExporter org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration.mbeanExporter; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [org.springframework.jmx.export.MBeanExporter] is defined: more than one 'primary' bean found among candidates: [mbeanExporter, integrationMbeanExporter, endpointMBeanExporter] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] ... 22 more Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [org.springframework.jmx.export.MBeanExporter] is defined: more than one 'primary' bean found among candidates: [mbeanExporter, integrationMbeanExporter, endpointMBeanExporter] at org.springframework.beans.factory.support.DefaultListableBeanFactory.determinePrimaryCandidate(DefaultListableBeanFactory.java:1255)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.determineAutowireCandidate(DefaultListableBeanFactory.java:1216)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1124)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] ... 24 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    7 times, 11 months ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    4 more bugmates