Class NoUniqueBeanDefinitionException

All Implemented Interfaces:
Serializable

public class NoUniqueBeanDefinitionException extends NoSuchBeanDefinitionException
Exception thrown when a BeanFactory is asked for a bean instance for which multiple matching candidates have been found when only one matching bean was expected.
Since:
3.2.1
Author:
Juergen Hoeller, Stephane Nicoll
See Also:
  • Constructor Details

    • NoUniqueBeanDefinitionException

      public NoUniqueBeanDefinitionException(Class<?> type, Collection<String> beanNamesFound, String message)
      Create a new NoUniqueBeanDefinitionException.
      Parameters:
      type - required type of the non-unique bean
      beanNamesFound - the names of all matching beans (as a Collection)
      message - detailed message describing the problem
      Since:
      6.2
    • NoUniqueBeanDefinitionException

      public NoUniqueBeanDefinitionException(Class<?> type, int numberOfBeansFound, String message)
      Create a new NoUniqueBeanDefinitionException.
      Parameters:
      type - required type of the non-unique bean
      numberOfBeansFound - the number of matching beans
      message - detailed message describing the problem
    • NoUniqueBeanDefinitionException

      public NoUniqueBeanDefinitionException(Class<?> type, Collection<String> beanNamesFound)
      Create a new NoUniqueBeanDefinitionException.
      Parameters:
      type - required type of the non-unique bean
      beanNamesFound - the names of all matching beans (as a Collection)
    • NoUniqueBeanDefinitionException

      public NoUniqueBeanDefinitionException(Class<?> type, String... beanNamesFound)
      Create a new NoUniqueBeanDefinitionException.
      Parameters:
      type - required type of the non-unique bean
      beanNamesFound - the names of all matching beans (as an array)
    • NoUniqueBeanDefinitionException

      public NoUniqueBeanDefinitionException(ResolvableType type, Collection<String> beanNamesFound)
      Create a new NoUniqueBeanDefinitionException.
      Parameters:
      type - required type of the non-unique bean
      beanNamesFound - the names of all matching beans (as a Collection)
      Since:
      5.1
    • NoUniqueBeanDefinitionException

      public NoUniqueBeanDefinitionException(ResolvableType type, String... beanNamesFound)
      Create a new NoUniqueBeanDefinitionException.
      Parameters:
      type - required type of the non-unique bean
      beanNamesFound - the names of all matching beans (as an array)
      Since:
      5.1
  • Method Details