org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.abc.xyz.Engine] is defined: expected single matching bean but found 2: e1,e2 at org.springframework.beans.factory.annotation. AutowiredAnnotationBeanPostProcessor .postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) at org.springframework.beans.factory.support. bstractAutowireCapableBeanFactory.populateBean (AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support. AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:543) at org.springframework.beans.factory.support. AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support. AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support. DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support. AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support. AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support. DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:772) at org.springframework.context.support. AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:839) at org.springframework.context.support. AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) at org.springframework.context.support. ClassPathXmlApplicationContext.<init> (ClassPathXmlApplicationContext.java:139) at org.springframework.context.support. ClassPathXmlApplicationContext.<init> (ClassPathXmlApplicationContext.java:83)

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

    @Qualifier() and @Autowired() not working

    Stack Overflow | 7 months ago | Shaik Yakhoob Ali
    org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.abc.xyz.Engine] is defined: expected single matching bean but found 2: e1,e2 at org.springframework.beans.factory.annotation. AutowiredAnnotationBeanPostProcessor .postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) at org.springframework.beans.factory.support. bstractAutowireCapableBeanFactory.populateBean (AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support. AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:543) at org.springframework.beans.factory.support. AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support. AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support. DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support. AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support. AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support. DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:772) at org.springframework.context.support. AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:839) at org.springframework.context.support. AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) at org.springframework.context.support. ClassPathXmlApplicationContext.<init> (ClassPathXmlApplicationContext.java:139) at org.springframework.context.support. ClassPathXmlApplicationContext.<init> (ClassPathXmlApplicationContext.java:83)

    Root Cause Analysis

    1. org.springframework.beans.factory.NoUniqueBeanDefinitionException

      No qualifying bean of type [com.abc.xyz.Engine] is defined: expected single matching bean but found 2: e1,e2 at org.springframework.beans.factory.annotation. AutowiredAnnotationBeanPostProcessor .postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) at org.springframework.beans.factory.support. bstractAutowireCapableBeanFactory.populateBean (AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support. AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:543) at org.springframework.beans.factory.support. AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support. AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support. DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support. AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support. AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support. DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:772) at org.springframework.context.support. AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:839) at org.springframework.context.support. AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) at org.springframework.context.support. ClassPathXmlApplicationContext.<init> (ClassPathXmlApplicationContext.java:139) at org.springframework.context.support. ClassPathXmlApplicationContext.<init> (ClassPathXmlApplicationContext.java:83)

      at com.abc.xyz.ClientApp.main()
    2. com.abc.xyz
      ClientApp.main
      1. com.abc.xyz.ClientApp.main(ClientApp.java:9)
      1 frame