Top Description Fields Constructors Methods
org.springframework.beans

public Class BeanInstantiationException

extends FatalBeanException
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.lang.reflect.Constructor, .Method, org.springframework.lang.Nullable

Exception thrown when instantiation of a bean failed. Carries the offending bean class.
Author
Juergen Hoeller
Since
1.2.8

Field Summary

Modifier and TypeField and Description
private final Class<?>
private final Method
private final Constructor<?>

Constructor Summary

AccessConstructor and Description
public
BeanInstantiationException(Class<?>
the offending bean class
beanClass
,
String
the detail message
msg
)

Create a new BeanInstantiationException.

public
BeanInstantiationException(Class<?>
the offending bean class
beanClass
,
String
the detail message
msg
,
Throwable
the root cause
cause
)

Create a new BeanInstantiationException.

public
BeanInstantiationException(Constructor<?>
the offending constructor
constructor
,
String
the detail message
msg
,
Throwable
the root cause
cause
)

Create a new BeanInstantiationException.

public
BeanInstantiationException(Method
the delegate for bean construction purposes (typically, but not necessarily, a static factory method)
constructingMethod
,
String
the detail message
msg
,
Throwable
the root cause
cause
)

Create a new BeanInstantiationException.

Method Summary

Modifier and TypeMethod and Description
public Class<?>

Returns:

the class that was to be instantiated
getBeanClass
()

Return the offending bean class (never null).

public Method

Returns:

the method in use (typically a static factory method), or null in case of constructor-based instantiation
getConstructingMethod
()

Return the delegate for bean construction purposes, if known.

public Constructor<?>

Returns:

the constructor in use, or null in case of a factory method or in case of default instantiation
getConstructor
()

Return the offending constructor, if known.

Field Detail

beanClassback to summary
private final Class<?> beanClass
constructingMethodback to summary
private final Method constructingMethod
Annotations
@Nullable
constructorback to summary
private final Constructor<?> constructor
Annotations
@Nullable

Constructor Detail

BeanInstantiationExceptionback to summary
public BeanInstantiationException(Class<?> beanClass, String msg)

Create a new BeanInstantiationException.

Parameters
beanClass:Class<?>

the offending bean class

msg:String

the detail message

BeanInstantiationExceptionback to summary
public BeanInstantiationException(Class<?> beanClass, String msg, Throwable cause)

Create a new BeanInstantiationException.

Parameters
beanClass:Class<?>

the offending bean class

msg:String

the detail message

cause:Throwable

the root cause

BeanInstantiationExceptionback to summary
public BeanInstantiationException(Constructor<?> constructor, String msg, Throwable cause)

Create a new BeanInstantiationException.

Parameters
constructor:Constructor<?>

the offending constructor

msg:String

the detail message

cause:Throwable

the root cause

Since
4.3
BeanInstantiationExceptionback to summary
public BeanInstantiationException(Method constructingMethod, String msg, Throwable cause)

Create a new BeanInstantiationException.

Parameters
constructingMethod:Method

the delegate for bean construction purposes (typically, but not necessarily, a static factory method)

msg:String

the detail message

cause:Throwable

the root cause

Since
4.3

Method Detail

getBeanClassback to summary
public Class<?> getBeanClass()

Return the offending bean class (never null).

Returns:Class<?>

the class that was to be instantiated

getConstructingMethodback to summary
public Method getConstructingMethod()

Return the delegate for bean construction purposes, if known.

Returns:Method

the method in use (typically a static factory method), or null in case of constructor-based instantiation

Annotations
@Nullable
Since
4.3
getConstructorback to summary
public Constructor<?> getConstructor()

Return the offending constructor, if known.

Returns:Constructor<?>

the constructor in use, or null in case of a factory method or in case of default instantiation

Annotations
@Nullable
Since
4.3