public class

BeanCreationException

extends FatalBeanException
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.factory.BeanCreationException
Known Direct Subclasses

Class Overview

Exception thrown when a BeanFactory encounters an error when attempting to create a bean from a bean definition.

Summary

Public Constructors
BeanCreationException(String msg)
Create a new BeanCreationException.
BeanCreationException(String msg, Throwable cause)
Create a new BeanCreationException.
BeanCreationException(String beanName, String msg)
Create a new BeanCreationException.
BeanCreationException(String beanName, String msg, Throwable cause)
Create a new BeanCreationException.
BeanCreationException(String resourceDescription, String beanName, String msg)
Create a new BeanCreationException.
BeanCreationException(String resourceDescription, String beanName, String msg, Throwable cause)
Create a new BeanCreationException.
Public Methods
void addRelatedCause(Throwable ex)
Add a related cause to this bean creation exception, not being a direct cause of the failure but having occured earlier in the creation of the same bean instance.
boolean contains(Class exClass)
Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.
String getBeanName()
Return the name of the bean requested, if any.
Throwable[] getRelatedCauses()
Return the related causes, if any.
String getResourceDescription()
Return the description of the resource that the bean definition came from, if any.
void printStackTrace(PrintWriter pw)
void printStackTrace(PrintStream ps)
String toString()
[Expand]
Inherited Methods
From class org.springframework.beans.BeansException
From class org.springframework.core.NestedRuntimeException
From class java.lang.Throwable
From class java.lang.Object

Public Constructors

public BeanCreationException (String msg)

Also: SpringBeans

Create a new BeanCreationException.

Parameters
msg the detail message

public BeanCreationException (String msg, Throwable cause)

Also: SpringBeans

Create a new BeanCreationException.

Parameters
msg the detail message
cause the root cause

public BeanCreationException (String beanName, String msg)

Also: SpringBeans

Create a new BeanCreationException.

Parameters
beanName the name of the bean requested
msg the detail message

public BeanCreationException (String beanName, String msg, Throwable cause)

Also: SpringBeans

Create a new BeanCreationException.

Parameters
beanName the name of the bean requested
msg the detail message
cause the root cause

public BeanCreationException (String resourceDescription, String beanName, String msg)

Also: SpringBeans

Create a new BeanCreationException.

Parameters
resourceDescription description of the resource that the bean definition came from
beanName the name of the bean requested
msg the detail message

public BeanCreationException (String resourceDescription, String beanName, String msg, Throwable cause)

Also: SpringBeans

Create a new BeanCreationException.

Parameters
resourceDescription description of the resource that the bean definition came from
beanName the name of the bean requested
msg the detail message
cause the root cause

Public Methods

public void addRelatedCause (Throwable ex)

Also: SpringBeans

Add a related cause to this bean creation exception, not being a direct cause of the failure but having occured earlier in the creation of the same bean instance.

Parameters
ex the related cause to add

public boolean contains (Class exClass)

Also: SpringBeans

Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.

Parameters
exClass the exception type to look for
Returns
  • whether there is a nested exception of the specified type

public String getBeanName ()

Also: SpringBeans

Return the name of the bean requested, if any.

public Throwable[] getRelatedCauses ()

Also: SpringBeans

Return the related causes, if any.

Returns
  • the array of related causes, or null if none

public String getResourceDescription ()

Also: SpringBeans

Return the description of the resource that the bean definition came from, if any.

public void printStackTrace (PrintWriter pw)

Also: SpringBeans

public void printStackTrace (PrintStream ps)

Also: SpringBeans

public String toString ()

Also: SpringBeans