org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [ru.yandex.commune.junk.stepancheg.spring.shinderuk.Coin] is defined: expected single bean but found 0:

Spring JIRA | Stepan Koltsov | 6 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

    @ComponentScan does not work in @Import-ed configuration. {code} public class Coin { } public class Main { @Configuration @ComponentScan(basePackageClasses = Main.class, useDefaultFilters = false, includeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = Coin.class)) public static class Conf1 { } @Configuration @Import(Conf1.class) public static class Conf2 { } public static void main(String[] args) { System.out.println("loading Conf1"); // works fine new AnnotationConfigApplicationContext(Conf1.class).getBean(Coin.class); System.out.println("loading Conf2"); // cannot find a bean new AnnotationConfigApplicationContext(Conf2.class).getBean(Coin.class); System.out.println("Unreachable in Spring 3.1.0.M2"); } } {code} Outputs: {code} loading Conf1 loading Conf2 Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [ru.yandex.commune.junk.stepancheg.spring.shinderuk.Coin] is defined: expected single bean but found 0: at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:269) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1101) at ru.yandex.commune.junk.stepancheg.spring.shinderuk.Main.main(Main.java:31) {code} Probably related to SPR-8307.

    Spring JIRA | 6 years ago | Stepan Koltsov
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [ru.yandex.commune.junk.stepancheg.spring.shinderuk.Coin] is defined: expected single bean but found 0:
  2. 0

    @ComponentScan does not work in @Import-ed configuration. {code} public class Coin { } public class Main { @Configuration @ComponentScan(basePackageClasses = Main.class, useDefaultFilters = false, includeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = Coin.class)) public static class Conf1 { } @Configuration @Import(Conf1.class) public static class Conf2 { } public static void main(String[] args) { System.out.println("loading Conf1"); // works fine new AnnotationConfigApplicationContext(Conf1.class).getBean(Coin.class); System.out.println("loading Conf2"); // cannot find a bean new AnnotationConfigApplicationContext(Conf2.class).getBean(Coin.class); System.out.println("Unreachable in Spring 3.1.0.M2"); } } {code} Outputs: {code} loading Conf1 loading Conf2 Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [ru.yandex.commune.junk.stepancheg.spring.shinderuk.Coin] is defined: expected single bean but found 0: at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:269) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1101) at ru.yandex.commune.junk.stepancheg.spring.shinderuk.Main.main(Main.java:31) {code} Probably related to SPR-8307.

    Spring JIRA | 6 years ago | Stepan Koltsov
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [ru.yandex.commune.junk.stepancheg.spring.shinderuk.Coin] is defined: expected single bean but found 0:
  3. 0

    SVN / if not used, exception are returned

    GitHub | 4 years ago | fxprunayre
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.fao.geonet.kernel.SvnManager] is defined: expected single bean but found 0:
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    exception stack trace is truncated

    GitHub | 4 years ago | kgignatyev
    java.lang.ExceptionInInitializerError
  6. 0

    GWT RequestFactory Error when firing request : org.springframework.beans.factory.NoSuchBeanDefinitionException

    Google Groups | 5 years ago | Radu Chilom
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.aievas.star.shared.services.StarRequestFactory$RaduRequestContext] is defined: expected single bean but found 0:

  1. Gatgeagent 4 times, last 7 months ago
  2. Pilleo 6 times, last 8 months ago
  3. qavid 2 times, last 11 months ago
  4. MrMonkey 3 times, last 1 year ago
  5. iferca 1 times, last 3 months ago
4 more registered users
19 unregistered visitors
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 [ru.yandex.commune.junk.stepancheg.spring.shinderuk.Coin] is defined: expected single bean but found 0:

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean()
  2. Spring Beans
    DefaultListableBeanFactory.getBean
    1. org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:269)
    1 frame
  3. Spring Context
    AbstractApplicationContext.getBean
    1. org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1101)
    1 frame
  4. ru.yandex.commune
    Main.main
    1. ru.yandex.commune.junk.stepancheg.spring.shinderuk.Main.main(Main.java:31)
    1 frame