Class BeanInstantiationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.beans.BeansException
org.springframework.beans.FatalBeanException
org.springframework.beans.BeanInstantiationException
- All Implemented Interfaces:
- Serializable
Exception thrown when instantiation of a bean failed.
Carries the offending bean class.
- Since:
- 1.2.8
- Author:
- Juergen Hoeller
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionBeanInstantiationException(Class<?> beanClass, String msg) Create a new BeanInstantiationException.BeanInstantiationException(Class<?> beanClass, String msg, @Nullable Throwable cause) Create a new BeanInstantiationException.BeanInstantiationException(Constructor<?> constructor, @Nullable String msg, @Nullable Throwable cause) Create a new BeanInstantiationException.BeanInstantiationException(Method constructingMethod, @Nullable String msg, @Nullable Throwable cause) Create a new BeanInstantiationException.
- 
Method SummaryModifier and TypeMethodDescriptionClass<?> Return the offending bean class (nevernull).Return the delegate for bean construction purposes, if known.Return the offending constructor, if known.Methods inherited from class NestedRuntimeExceptioncontains, getMostSpecificCause, getRootCauseMethods inherited from class ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
- 
Constructor Details- 
BeanInstantiationException
- 
BeanInstantiationException
- 
BeanInstantiationExceptionpublic BeanInstantiationException(Constructor<?> constructor, @Nullable String msg, @Nullable Throwable cause) Create a new BeanInstantiationException.- Parameters:
- constructor- the offending constructor
- msg- the detail message
- cause- the root cause
- Since:
- 4.3
 
- 
BeanInstantiationExceptionpublic BeanInstantiationException(Method constructingMethod, @Nullable String msg, @Nullable Throwable cause) Create a new BeanInstantiationException.- Parameters:
- constructingMethod- the delegate for bean construction purposes (typically, but not necessarily, a static factory method)
- msg- the detail message
- cause- the root cause
- Since:
- 4.3
 
 
- 
- 
Method Details- 
getBeanClassReturn the offending bean class (nevernull).- Returns:
- the class that was to be instantiated
 
- 
getConstructorReturn the offending constructor, if known.- Returns:
- the constructor in use, or nullin case of a factory method or in case of default instantiation
- Since:
- 4.3
 
- 
getConstructingMethod
 
-