Class BeanNotOfRequiredTypeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.beans.BeansException
org.springframework.beans.factory.BeanNotOfRequiredTypeException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BeanIsNotAFactoryException
Thrown when a bean doesn't match the expected type.
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
-
Constructor Summary
ConstructorDescriptionBeanNotOfRequiredTypeException
(String beanName, Class<?> requiredType, Class<?> actualType) Create a new BeanNotOfRequiredTypeException. -
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
BeanNotOfRequiredTypeException
Create a new BeanNotOfRequiredTypeException.- Parameters:
beanName
- the name of the bean requestedrequiredType
- the required typeactualType
- the actual type returned, which did not match the expected type
-
-
Method Details
-
getBeanName
Return the name of the instance that was of the wrong type. -
getRequiredType
Return the expected type for the bean. -
getActualType
Return the actual type of the instance found.
-