public class NoUniqueBeanDefinitionException extends NoSuchBeanDefinitionException
BeanFactory is asked for a bean instance for which
multiple matching candidates have been found when only one matching bean was expected.BeanFactory.getBean(Class),
Serialized Form| Constructor and Description |
|---|
NoUniqueBeanDefinitionException(Class<?> type,
Collection<String> beanNamesFound)
Create a new
NoUniqueBeanDefinitionException. |
NoUniqueBeanDefinitionException(Class<?> type,
int numberOfBeansFound,
String message)
Create a new
NoUniqueBeanDefinitionException. |
NoUniqueBeanDefinitionException(Class<?> type,
String... beanNamesFound)
Create a new
NoUniqueBeanDefinitionException. |
| Modifier and Type | Method and Description |
|---|---|
int |
getNumberOfBeansFound()
Return the number of beans found when only one matching bean was expected.
|
getBeanName, getBeanTypeequals, hashCodecontains, getMessage, getMostSpecificCause, getRootCauseaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic NoUniqueBeanDefinitionException(Class<?> type, int numberOfBeansFound, String message)
NoUniqueBeanDefinitionException.type - required type of the non-unique beannumberOfBeansFound - the number of matching beansmessage - detailed message describing the problempublic NoUniqueBeanDefinitionException(Class<?> type, Collection<String> beanNamesFound)
NoUniqueBeanDefinitionException.type - required type of the non-unique beanbeanNamesFound - the names of all matching beans (as a Collection)public int getNumberOfBeansFound()
getNumberOfBeansFound in class NoSuchBeanDefinitionExceptionNoSuchBeanDefinitionException.getBeanType()