public class NoSuchBeanDefinitionException extends BeansException
BeanFactory is asked for a bean instance for which it
cannot find a definition. This may point to a non-existing bean, a non-unique bean,
or a manually registered singleton instance without an associated bean definition.BeanFactory.getBean(String),
BeanFactory.getBean(Class),
NoUniqueBeanDefinitionException,
Serialized Form| Constructor and Description |
|---|
NoSuchBeanDefinitionException(java.lang.Class<?> type)
Create a new
NoSuchBeanDefinitionException. |
NoSuchBeanDefinitionException(java.lang.Class<?> type,
java.lang.String message)
Create a new
NoSuchBeanDefinitionException. |
NoSuchBeanDefinitionException(java.lang.Class<?> type,
java.lang.String dependencyDescription,
java.lang.String message)
Deprecated.
as of 4.3.4, in favor of
NoSuchBeanDefinitionException(ResolvableType, String) |
NoSuchBeanDefinitionException(org.springframework.core.ResolvableType type)
Create a new
NoSuchBeanDefinitionException. |
NoSuchBeanDefinitionException(org.springframework.core.ResolvableType type,
java.lang.String message)
Create a new
NoSuchBeanDefinitionException. |
NoSuchBeanDefinitionException(java.lang.String name)
Create a new
NoSuchBeanDefinitionException. |
NoSuchBeanDefinitionException(java.lang.String name,
java.lang.String message)
Create a new
NoSuchBeanDefinitionException. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getBeanName()
Return the name of the missing bean, if it was a lookup by name that failed.
|
java.lang.Class<?> |
getBeanType()
Return the required type of the missing bean, if it was a lookup by type
that failed.
|
int |
getNumberOfBeansFound()
Return the number of beans found when only one matching bean was expected.
|
org.springframework.core.ResolvableType |
getResolvableType()
Return the required
ResolvableType of the missing bean, if it was a lookup
by type that failed. |
equals, hashCodecontains, getMessage, getMostSpecificCause, getRootCausepublic NoSuchBeanDefinitionException(java.lang.String name)
NoSuchBeanDefinitionException.name - the name of the missing beanpublic NoSuchBeanDefinitionException(java.lang.String name,
java.lang.String message)
NoSuchBeanDefinitionException.name - the name of the missing beanmessage - detailed message describing the problempublic NoSuchBeanDefinitionException(java.lang.Class<?> type)
NoSuchBeanDefinitionException.type - required type of the missing beanpublic NoSuchBeanDefinitionException(java.lang.Class<?> type,
java.lang.String message)
NoSuchBeanDefinitionException.type - required type of the missing beanmessage - detailed message describing the problempublic NoSuchBeanDefinitionException(org.springframework.core.ResolvableType type)
NoSuchBeanDefinitionException.type - full type declaration of the missing beanpublic NoSuchBeanDefinitionException(org.springframework.core.ResolvableType type,
java.lang.String message)
NoSuchBeanDefinitionException.type - full type declaration of the missing beanmessage - detailed message describing the problem@Deprecated
public NoSuchBeanDefinitionException(java.lang.Class<?> type,
java.lang.String dependencyDescription,
java.lang.String message)
NoSuchBeanDefinitionException(ResolvableType, String)NoSuchBeanDefinitionException.type - required type of the missing beandependencyDescription - a description of the originating dependencymessage - detailed message describing the problempublic java.lang.String getBeanName()
public java.lang.Class<?> getBeanType()
public org.springframework.core.ResolvableType getResolvableType()
ResolvableType of the missing bean, if it was a lookup
by type that failed.public int getNumberOfBeansFound()
NoUniqueBeanDefinitionException